@@ -613,12 +613,6 @@ require('lazy').setup({
613
613
},
614
614
}
615
615
616
- -- LSP servers and clients are able to communicate to each other what features they support.
617
- -- By default, Neovim doesn't support everything that is in the LSP specification.
618
- -- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
619
- -- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
620
- local capabilities = require (' blink.cmp' ).get_lsp_capabilities ()
621
-
622
616
-- Enable the following language servers
623
617
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
624
618
--
@@ -657,12 +651,32 @@ require('lazy').setup({
657
651
},
658
652
},
659
653
elixirls = {
660
- dialyzerEnabled = false ,
654
+ dialyzerEnabled = true ,
661
655
fetchDeps = false ,
662
656
},
663
657
ts_ls = {},
664
658
}
665
659
660
+ --- @type MasonLspconfigSettings
661
+ require (' mason-lspconfig' ).setup {
662
+ ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
663
+ -- NOTE: When the keys of servers are passed as a table to automatic_enable,
664
+ -- it causes mason-lspconfig to ignore any LSPs that are installed via Mason
665
+ -- but not explicitly listed in servers.
666
+ -- https://github.com/nvim-lua/kickstart.nvim/pull/1475/files#r2094166972
667
+ automatic_enable = vim .tbl_keys (servers or {}),
668
+ -- TODO: remove this ?
669
+ -- handlers = {
670
+ -- function(server_name)
671
+ -- local config = servers[server_name] or {}
672
+ -- vim.lsp.config(server_name, config)
673
+ -- -- It should not be necessary with Mason 2
674
+ -- -- https://github.com/nvim-lua/kickstart.nvim/pull/1475#discussion_r2077249925
675
+ -- -- vim.lsp.enable(server_name)
676
+ -- end,
677
+ -- },
678
+ }
679
+
666
680
-- Ensure the servers and tools above are installed
667
681
--
668
682
-- To check the current status of installed tools and/or manually install
@@ -682,21 +696,14 @@ require('lazy').setup({
682
696
' markdownlint' , -- Used to format Markdown files
683
697
})
684
698
require (' mason-tool-installer' ).setup { ensure_installed = ensure_installed }
699
+ -- Installed LSPs are configured and enabled automatically with mason-lspconfig
700
+ -- The loop below is for overriding the default configuration of LSPs with the ones in the servers table
701
+ for server_name , config in pairs (servers ) do
702
+ vim .lsp .config (server_name , config )
703
+ end
685
704
686
- require (' mason-lspconfig' ).setup {
687
- ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
688
- automatic_installation = false ,
689
- handlers = {
690
- function (server_name )
691
- local server = servers [server_name ] or {}
692
- -- This handles overriding only values explicitly passed
693
- -- by the server configuration above. Useful when disabling
694
- -- certain features of an LSP (for example, turning off formatting for ts_ls)
695
- server .capabilities = vim .tbl_deep_extend (' force' , {}, capabilities , server .capabilities or {})
696
- require (' lspconfig' )[server_name ].setup (server )
697
- end ,
698
- },
699
- }
705
+ -- NOTE: Some servers may require an old setup until they are updated. For the full list refer here: https://github.com/neovim/nvim-lspconfig/issues/3705
706
+ -- These servers will have to be manually set up with require("lspconfig").server_name.setup{}
700
707
end ,
701
708
},
702
709
0 commit comments