nvim: added automatic detection of language servers

This commit is contained in:
PowerUser64 2021-09-22 03:19:20 -07:00
parent c9b000765e
commit 37575bcd55

View file

@ -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 >>>