dotfiles/symlinks/config/nvim/lua/lsp/servers.lua

81 lines
1.9 KiB
Lua
Raw Normal View History

2021-02-23 11:27:32 +00:00
-------------------------------------------------------------------------------
-- - LSP servers configuration -
-------------------------------------------------------------------------------
local lspconfig = require("lspconfig")
2021-10-02 23:36:29 +00:00
local common_config = require("lsp.server_config")
2021-02-24 14:13:56 +00:00
local capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities())
2021-10-08 14:28:07 +00:00
2021-02-24 14:13:56 +00:00
-- Lsp default language servers
local servers = {
"bashls",
"clangd",
2022-03-30 20:29:25 +00:00
"clojure_lsp",
"cmake",
"crystalline",
2022-03-30 20:29:25 +00:00
"cucumber_language_server",
"dockerls",
2022-03-30 20:29:25 +00:00
"gopls",
"hls",
2022-03-30 20:29:25 +00:00
"jsonls",
"kotlin_language_server",
"mint",
2022-03-30 20:29:25 +00:00
"pyright",
"rust_analyzer",
"solang",
"terraformls",
2022-03-30 20:29:25 +00:00
"tsserver",
"vimls",
}
2021-02-24 14:13:56 +00:00
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = common_config.on_attach,
capabilities = capabilities
}
2021-02-23 11:27:32 +00:00
end
lspconfig["gdscript"].setup {
on_attach = common_config.on_attach,
capabilities = capabilities,
flags = {
-- Slow Godot LS
debounce_text_changes = 600
}
}
2021-02-23 11:27:32 +00:00
-- Lua bultin lsp
require("nlua.lsp.nvim").setup(
lspconfig,
{
on_attach = common_config.on_attach,
capabilities = capabilities,
-- Include globals you want to tell the LSP are real :)
globals = {}
}
)
2021-03-17 19:34:03 +00:00
-- Flutter tools
require("flutter-tools").setup {
lsp = {
on_attach = common_config.on_attach,
capabilities = capabilities
}
2021-03-17 19:34:03 +00:00
}
2021-04-07 19:50:46 +00:00
-- Dotnet LS
local pid = vim.fn.getpid()
local omnisharp_bin = vim.fn.glob("$HOME") .. "/lsp/dotnet/omnisharp/run"
2021-04-07 19:50:46 +00:00
lspconfig.omnisharp.setup {
cmd = {omnisharp_bin, "--languageserver", "--hostPID", tostring(pid)},
on_attach = common_config.on_attach,
capabilities = capabilities
2021-04-07 19:50:46 +00:00
}
2021-06-11 10:20:00 +00:00
2021-09-29 15:39:19 +00:00
-- Leminx (XML Language server)
lspconfig.lemminx.setup {
cmd = {"lemminx"},
on_attach = common_config.on_attach,
capabilities = capabilities
2021-06-11 11:15:36 +00:00
}