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
|
|
|
|
2021-12-02 15:12:10 +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
|
2021-12-02 15:12:10 +00:00
|
|
|
local servers = {
|
|
|
|
"bashls",
|
|
|
|
"clangd",
|
|
|
|
"cucumber_language_server",
|
|
|
|
"crystalline",
|
|
|
|
"dockerls",
|
|
|
|
"jsonls",
|
|
|
|
"hls",
|
|
|
|
"pyright",
|
|
|
|
"rust_analyzer",
|
|
|
|
"kotlin_language_server",
|
|
|
|
"mint",
|
|
|
|
"vimls",
|
|
|
|
"clojure_lsp",
|
|
|
|
"gopls",
|
|
|
|
"solang",
|
|
|
|
"terraformls",
|
|
|
|
"tsserver"
|
|
|
|
}
|
2021-02-24 14:13:56 +00:00
|
|
|
for _, lsp in ipairs(servers) do
|
2021-12-02 15:12:10 +00:00
|
|
|
lspconfig[lsp].setup {
|
|
|
|
on_attach = common_config.on_attach,
|
|
|
|
capabilities = capabilities
|
|
|
|
}
|
2021-02-23 11:27:32 +00:00
|
|
|
end
|
|
|
|
|
2021-12-02 15:12:10 +00:00
|
|
|
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
|
|
|
|
2021-12-02 15:12:10 +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
|
2021-12-02 15:12:10 +00:00
|
|
|
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()
|
2021-12-02 15:12:10 +00:00
|
|
|
local omnisharp_bin = vim.fn.glob("$HOME") .. "/lsp/dotnet/omnisharp/run"
|
2021-04-07 19:50:46 +00:00
|
|
|
lspconfig.omnisharp.setup {
|
2021-12-02 15:12:10 +00:00
|
|
|
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 {
|
2021-12-02 15:12:10 +00:00
|
|
|
cmd = {"lemminx"},
|
|
|
|
on_attach = common_config.on_attach,
|
|
|
|
capabilities = capabilities
|
2021-06-11 11:15:36 +00:00
|
|
|
}
|