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

78 lines
1.7 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 = {
2022-04-28 13:53:54 +00:00
"bashls",
"clangd",
"clojure_lsp",
"cmake",
"crystalline",
"cucumber_language_server",
"dockerls",
"gopls",
"hls",
"jsonls",
"kotlin_language_server",
"mint",
"pyright",
"rust_analyzer",
"solang",
"terraformls",
"tsserver",
"vimls",
}
2021-02-24 14:13:56 +00:00
for _, lsp in ipairs(servers) do
2022-04-28 13:53:54 +00:00
lspconfig[lsp].setup({
on_attach = common_config.on_attach,
capabilities = capabilities,
})
2021-02-23 11:27:32 +00:00
end
2022-04-28 13:53:54 +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
-- Lua bultin lsp
2022-04-28 13:53:54 +00:00
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
2022-04-28 13:53:54 +00:00
require("flutter-tools").setup({
lsp = {
on_attach = common_config.on_attach,
capabilities = capabilities,
},
})
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"
2022-04-28 13:53:54 +00:00
lspconfig.omnisharp.setup({
cmd = { omnisharp_bin, "--languageserver", "--hostPID", tostring(pid) },
on_attach = common_config.on_attach,
capabilities = capabilities,
})
2021-06-11 10:20:00 +00:00
2021-09-29 15:39:19 +00:00
-- Leminx (XML Language server)
2022-04-28 13:53:54 +00:00
lspconfig.lemminx.setup({
cmd = { "lemminx" },
on_attach = common_config.on_attach,
capabilities = capabilities,
})