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

42 lines
1.3 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
-- Lsp default language servers
2021-09-29 20:45:40 +00:00
local servers = { "bashls", "clangd", "cucumber_language_server", "crystalline", "dockerls", "jsonls", "pyright", "rust_analyzer", "kotlin_language_server", "mint", "vimls", "clojure_lsp", "gopls", "gdscript", "terraformls", "tsserver" }
2021-02-24 14:13:56 +00:00
for _, lsp in ipairs(servers) do
2021-10-02 23:36:29 +00:00
lspconfig[lsp].setup { on_attach = common_config.on_attach }
2021-02-23 11:27:32 +00:00
end
-- Lua bultin lsp
2021-03-05 10:08:05 +00:00
require('nlua.lsp.nvim').setup(lspconfig, {
2021-10-02 23:36:29 +00:00
on_attach = common_config.on_attach,
2021-02-23 11:27:32 +00:00
2021-03-05 10:08:05 +00:00
-- Include globals you want to tell the LSP are real :)
2021-03-17 19:34:03 +00:00
globals = {}
2021-03-05 10:08:05 +00:00
})
2021-03-17 19:34:03 +00:00
-- Flutter tools
require('flutter-tools').setup {
lsp = {
2021-10-02 23:36:29 +00:00
on_attach = common_config.on_attach
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"
lspconfig.omnisharp.setup {
cmd = { omnisharp_bin, "--languageserver" , "--hostPID", tostring(pid) };
2021-10-02 23:36:29 +00:00
on_attach = common_config.on_attach;
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" };
2021-10-02 23:36:29 +00:00
on_attach = common_config.on_attach;
2021-06-11 11:15:36 +00:00
}