dotfiles/.config/nvim/lua/lsp.lua

56 lines
1.4 KiB
Lua
Raw Normal View History

2021-08-24 18:17:11 +02:00
local lspconfig = require('lspconfig')
local lsp_status = require('lsp-status')
lsp_status.register_progress()
-- Some arbitrary servers
lspconfig.clangd.setup({
handlers = lsp_status.extensions.clangd.setup(),
init_options = {
clangdFileStatus = true
},
on_attach = lsp_status.on_attach,
capabilities = lsp_status.capabilities
})
lspconfig.rust_analyzer.setup({
on_attach = lsp_status.on_attach,
capabilities = lsp_status.capabilities
})
lspconfig.pyright.setup({
on_attach = lsp_status.on_attach,
capabilities = lsp_status.capabilities
})
lspconfig.elmls.setup({
on_attach = lsp_status.on_attach,
capabilities = lsp_status.capabilities
})
lspconfig.svelte.setup({
on_attach = lsp_status.on_attach,
capabilities = lsp_status.capabilities
})
lspconfig.tsserver.setup({
on_attach = lsp_status.on_attach,
capabilities = lsp_status.capabilities
})
lspconfig.gdscript.setup({
on_attach = function (client)
local _notify = client.notify
client.notify = function (method, params)
if method == 'textDocument/didClose' then
-- Godot doesn't implement didClose yet
return
end
_notify(method, params)
end
lsp_status.on_attach(client)
end,
capabilities = lsp_status.capabilities,
flags = {
debounce_text_changes = 150,
}
})