Fix LSP
This commit is contained in:
parent
dccd511bf7
commit
7d665bd859
1 changed files with 20 additions and 26 deletions
46
init.lua
46
init.lua
|
|
@ -139,16 +139,16 @@ end
|
||||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||||
-- map buffer local keybindings when the language server attaches
|
-- map buffer local keybindings when the language server attaches
|
||||||
local servers = {
|
local servers = {
|
||||||
clangd,
|
clangd = {},
|
||||||
gopls,
|
gopls = {},
|
||||||
jsonls,
|
jsonls = {},
|
||||||
kotlin_language_server,
|
kotlin_language_server = {},
|
||||||
marksman,
|
marksman = {},
|
||||||
pylsp,
|
pylsp = {},
|
||||||
rust_analyzer,
|
rust_analyzer = {},
|
||||||
texlab,
|
texlab = {},
|
||||||
tflint,
|
tflint = {},
|
||||||
tsserver,
|
tsserver = {},
|
||||||
}
|
}
|
||||||
-- Setup loop moved to the cmp section, since calling setup multiple times
|
-- Setup loop moved to the cmp section, since calling setup multiple times
|
||||||
-- overrides the previous calls.
|
-- overrides the previous calls.
|
||||||
|
|
@ -216,23 +216,17 @@ cmp.setup({
|
||||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||||
lsp.util.default_config = vim.tbl_deep_extend(
|
lsp.util.default_config = vim.tbl_deep_extend(
|
||||||
'force', lsp.util.default_config, { capabilities = capabilities, })
|
'force', lsp.util.default_config, { capabilities = capabilities, })
|
||||||
for server, settings in pairs(servers) do
|
for server, add_to_config in pairs(servers) do
|
||||||
if settings then
|
config = {
|
||||||
lsp[server].setup({
|
on_attach = on_lsp_attach,
|
||||||
on_attach = on_lsp_attach,
|
flags = {
|
||||||
flags = {
|
debounce_text_changes = 150,
|
||||||
debounce_text_changes = 150,
|
},
|
||||||
},
|
}
|
||||||
settings = settings,
|
for k,v in pairs(add_to_config) do
|
||||||
})
|
config[k] = v
|
||||||
else
|
|
||||||
lsp[server].setup({
|
|
||||||
on_attach = on_lsp_attach,
|
|
||||||
flags = {
|
|
||||||
debounce_text_changes = 150,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end
|
end
|
||||||
|
lsp[server].setup(config)
|
||||||
end
|
end
|
||||||
---- git-blame.nvim
|
---- git-blame.nvim
|
||||||
g.gitblame_enabled = 0
|
g.gitblame_enabled = 0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue