@@ -705,14 +705,19 @@ require('lazy').setup({
705705 })
706706 require (' mason-tool-installer' ).setup { ensure_installed = ensure_installed }
707707
708- -- Handle LSP setups
709- -- See :help vim.lsp.enable
710- for server , config in pairs (servers ) do
711- vim .lsp .config (server , config )
712- vim .lsp .enable (server )
713- end
708+ require (' mason-lspconfig' ).setup {
709+ ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
710+ automatic_installation = false ,
711+ handlers = {
712+ function (server_name )
713+ local config = servers [server_name ] or {}
714+ vim .lsp .config (server_name , config )
715+ vim .lsp .enable (server_name )
716+ end ,
717+ },
718+ }
714719 -- NOTE: Some servers still require the nvim-lspconfig setup until they are updated
715- -- Use this template inside the for loop if you encounter issues with an lsp
720+ -- Add this template inside the handler function after initializing config if you encounter issues with any lsp
716721 --
717722 -- if server == 'example_server' or server == 'example_server2' then
718723 -- -- This handles overriding only values explicitly passed
@@ -721,12 +726,10 @@ require('lazy').setup({
721726 -- local capabilities = require('blink.cmp').get_lsp_capabilities()
722727 -- config.capabilities = vim.tbl_deep_extend('force', {}, capabilities, config.capabilities or {})
723728 -- require('mason-lspconfig')[server].setup(config)
724- -- else
725- -- vim.lsp.config(server, config)
726- -- vim.lsp.enable(server)
729+ -- return
727730 -- end
728731 --
729- -- LSP servers and clients are able to communicate to each other what features they support.
732+ -- LSP servers and clients are able to communicate to each other what features they support.
730733 -- With nvim-lspconfig setup, Neovim doesn't support everything that is in the LSP specification.
731734 -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
732735 -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
0 commit comments