nvim: added automatic detection of language servers
This commit is contained in:
parent
c9b000765e
commit
37575bcd55
1 changed files with 24 additions and 19 deletions
|
@ -216,8 +216,12 @@ M.lspconfig = function()
|
||||||
|
|
||||||
-- 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 = { 'clangd', }
|
local lsp_servers = {
|
||||||
for _, lsp in ipairs(servers) do
|
clangd = 'clangd',
|
||||||
|
html = 'vscode-html-language-server',
|
||||||
|
}
|
||||||
|
for lsp, exe in pairs(lsp_servers) do
|
||||||
|
if (vim.fn.executable(exe) == 1) then
|
||||||
nvim_lsp[lsp].setup {
|
nvim_lsp[lsp].setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach,
|
||||||
flags = {
|
flags = {
|
||||||
|
@ -225,6 +229,7 @@ M.lspconfig = function()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end -- <<<
|
end -- <<<
|
||||||
|
|
||||||
-- DAP: Debug Adapter Protocol >>>
|
-- DAP: Debug Adapter Protocol >>>
|
||||||
|
|
Loading…
Add table
Reference in a new issue