From 77330ca0131683a9b79ef5c34436a8fb05b86869 Mon Sep 17 00:00:00 2001 From: Steven Crawford Date: Mon, 27 Oct 2025 21:37:17 -0500 Subject: [PATCH] updated mason file --- lua/shelbybark/plugins/lsp/mason.lua | 74 +++++++++++++++------------- 1 file changed, 41 insertions(+), 33 deletions(-) diff --git a/lua/shelbybark/plugins/lsp/mason.lua b/lua/shelbybark/plugins/lsp/mason.lua index 88a11d9..d16e070 100644 --- a/lua/shelbybark/plugins/lsp/mason.lua +++ b/lua/shelbybark/plugins/lsp/mason.lua @@ -1,42 +1,50 @@ +-- lua/plugins/mason.lua return { - "mason-org/mason.nvim", - dependencies = { - "mason-org/mason-lspconfig.nvim", - "WhoIsSethDaniel/mason-tool-installer.nvim", + -- Make mason-lspconfig the primary spec and feed it opts + "mason-org/mason-lspconfig.nvim", + opts = { + -- LSPCONFIG SERVER NAMES here + ensure_installed = { + "html", + "cssls", + "tailwindcss", + "svelte", + "lua_ls", + "graphql", + "emmet_language_server", -- valid id in modern lspconfig + -- "ts_ls", + -- "prismals", + }, + -- automatic_enable = true, -- default; can omit }, - config = function() - local mason = require("mason") - local mason_lspconfig = require("mason-lspconfig") - local mason_tool_installer = require("mason-tool-installer") - - mason.setup({ - ui = { - icons = { - package_installed = "✓", - package_pending = "➜", - package_uninstalled = "✗", + dependencies = { + -- Ensure mason is set up first (we’ll give it opts inline) + { + "mason-org/mason.nvim", + opts = { + ui = { + icons = { + package_installed = "✓", + package_pending = "➜", + package_uninstalled = "✗", + }, }, }, - }) + }, - mason_lspconfig.setup({ - -- Use LSPCONFIG SERVER NAMES here - ensure_installed = { - "html", - "cssls", - "tailwindcss", - "svelte", - "lua_ls", - "graphql", - "emmet_language_server", -- <- was "emmet_ls" - "prismals", - -- "ts_ls", -- <- if you enable TypeScript later - }, - -- automatic_enable = true, -- default in v2; can omit - }) + -- CRITICAL: guarantee lspconfig is on rtp before mason-lspconfig runs + "neovim/nvim-lspconfig", - mason_tool_installer.setup({ - -- Use MASON PACKAGE NAMES here + -- Tools installer (uses Mason package names, not LSP ids) + "WhoIsSethDaniel/mason-tool-installer.nvim", + }, + + config = function(_, opts) + -- mason-lspconfig via opts + require("mason-lspconfig").setup(opts) + + -- tools installer stays separate and uses Mason package names + require("mason-tool-installer").setup({ ensure_installed = { "prettier", "stylua",