Replace monolithic 187-line lsp.lua with slim 35-line version that: - Delegates server config to per-language modules via the orchestrator - Uses vim.lsp.config() (Neovim 0.11+ API) instead of deprecated lspconfig setup - Uses mason-org repos (mason.nvim moved from williamboman to mason-org) - Relies on LspAttach autocmd in _shared.lua instead of per-server on_attach - Lets mason-lspconfig auto-enable installed servers
48 lines
1.3 KiB
Lua
48 lines
1.3 KiB
Lua
-- LSP plugin spec: delegates to language modules for server configuration.
|
|
-- Shared keymaps/on_attach handled by languages/_shared.lua (LspAttach autocmd).
|
|
local languages = require('languages')
|
|
|
|
return {
|
|
"neovim/nvim-lspconfig",
|
|
dependencies = {
|
|
{
|
|
"mason-org/mason.nvim",
|
|
opts = {
|
|
-- Prefer tools installed by the system package manager.
|
|
PATH = "append",
|
|
},
|
|
},
|
|
{
|
|
"mason-org/mason-lspconfig.nvim",
|
|
opts = {
|
|
ensure_installed = languages.mason_packages(),
|
|
-- Servers are enabled explicitly below, including non-Mason servers.
|
|
automatic_enable = false,
|
|
},
|
|
},
|
|
"j-hui/fidget.nvim",
|
|
"hrsh7th/cmp-nvim-lsp",
|
|
},
|
|
|
|
config = function()
|
|
-- Load the shared LspAttach autocmd and capabilities.
|
|
require('languages._shared')
|
|
|
|
-- Register and enable every server selected by the machine profile.
|
|
-- Explicit enablement also covers servers supplied outside Mason.
|
|
for name, conf in pairs(languages.servers()) do
|
|
vim.lsp.config(name, conf)
|
|
vim.lsp.enable(name)
|
|
end
|
|
|
|
-- LSP progress indicator
|
|
require('fidget').setup({
|
|
notification = {
|
|
window = {
|
|
avoid = { "NvimTree" },
|
|
},
|
|
},
|
|
})
|
|
end,
|
|
}
|