@@ -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
@@ -718,21 +726,6 @@ require('lazy').setup({
718726 ' stylua' , -- Used to format Lua code
719727 })
720728 require (' mason-tool-installer' ).setup { ensure_installed = ensure_installed }
721-
722- require (' mason-lspconfig' ).setup {
723- ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
724- automatic_installation = false ,
725- handlers = {
726- function (server_name )
727- local server = servers [server_name ] or {}
728- -- This handles overriding only values explicitly passed
729- -- by the server configuration above. Useful when disabling
730- -- certain features of an LSP (for example, turning off formatting for ts_ls)
731- server .capabilities = vim .tbl_deep_extend (' force' , {}, capabilities , server .capabilities or {})
732- require (' lspconfig' )[server_name ].setup (server )
733- end ,
734- },
735- }
736729 end ,
737730 },
738731
0 commit comments