Skip to content

Commit 4165674

Browse files
committed
fix(lsp): updated config for mason
reference to nvim-lua#1663 merge request: nvim-lua#1663
1 parent 3338d39 commit 4165674

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

init.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ require('lazy').setup({
483483
-- Mason must be loaded before its dependents so we need to set it up here.
484484
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
485485
{ 'mason-org/mason.nvim', opts = {} },
486-
'mason-org/mason-lspconfig.nvim',
486+
{ 'mason-org/mason-lspconfig.nvim' },
487487
'WhoIsSethDaniel/mason-tool-installer.nvim',
488488

489489
-- Useful status updates for LSP.
@@ -700,6 +700,14 @@ require('lazy').setup({
700700
},
701701
}
702702

703+
-- The following loop will configure each server with the capabilities we defined above.
704+
-- This will ensure that all servers have the same base configuration, but also
705+
-- allow for server-specific overrides.
706+
for server_name, server_config in pairs(servers) do
707+
server_config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server_config.capabilities or {})
708+
require('lspconfig')[server_name].setup(server_config)
709+
end
710+
703711
-- Ensure the servers and tools above are installed
704712
--
705713
-- To check the current status of installed tools and/or manually install

0 commit comments

Comments
 (0)