Skip to content

Commit 6fca7f5

Browse files
committed
fix: lsp config now works(pr nvim-lua#1590 from upstream)
1 parent bc1018f commit 6fca7f5

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

init.lua

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ require('lazy').setup({
669669
-- By default, Neovim doesn't support everything that is in the LSP specification.
670670
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
671671
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
672-
local capabilities = require('blink.cmp').get_lsp_capabilities()
672+
-- local capabilities = require('blink.cmp').get_lsp_capabilities()
673673

674674
-- Enable the following language servers
675675
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
@@ -738,26 +738,19 @@ require('lazy').setup({
738738
local ensure_installed = vim.tbl_keys(servers or {})
739739
vim.list_extend(ensure_installed, {
740740
'stylua', -- Used to format Lua code
741-
'pylsp',
742741
'clangd',
743742
'texlab',
744743
'rust_analyzer',
745744
})
746745
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
747-
746+
for server, config in pairs(vim.tbl_extend('keep', servers, {})) do
747+
if not vim.tbl_isempty(config) then
748+
vim.lsp.config(server, config)
749+
end
750+
end
748751
require('mason-lspconfig').setup {
749752
ensure_installed = {}, -- explicitly set to an empty table (Kickstart populates installs via mason-tool-installer)
750-
automatic_installation = false,
751-
handlers = {
752-
function(server_name)
753-
local server = servers[server_name] or {}
754-
-- This handles overriding only values explicitly passed
755-
-- by the server configuration above. Useful when disabling
756-
-- certain features of an LSP (for example, turning off formatting for ts_ls)
757-
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
758-
require('lspconfig')[server_name].setup(server)
759-
end,
760-
},
753+
automatic_enable = true, -- automatically run vim.lsp.enable() for all servers that are installed via Mason
761754
}
762755
end,
763756
},

0 commit comments

Comments
 (0)