neovim-confs/lua/custom/configs/lspconfig.lua

37 lines
754 B
Lua
Raw Normal View History

2024-01-19 22:34:37 +01:00
local on_attach = require("plugins.configs.lspconfig").on_attach
local capabilities = require("plugins.configs.lspconfig").capabilities
local lspconfig = require "lspconfig"
2024-03-12 19:37:42 +01:00
local lspsettings = require "custom.configs.lspsettings"
2024-01-19 22:34:37 +01:00
-- if you just want default config for the servers then put them in a table
2024-01-20 16:22:40 +01:00
local servers = {
"html",
"cssls",
"tsserver",
"clangd",
"bashls",
"cmake",
2024-03-11 14:38:16 +01:00
"yamlls",
2024-03-12 11:33:07 +01:00
"texlab",
2024-04-15 00:10:16 +02:00
"csharp_ls",
2024-01-20 16:22:40 +01:00
}
2024-01-19 22:34:37 +01:00
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_attach = on_attach,
capabilities = capabilities,
}
end
2024-02-16 15:53:23 +01:00
2024-03-12 19:37:42 +01:00
local server_with_settings = {
-- "textlsp",
"ltex",
"rust_analyzer",
2024-07-03 13:44:53 +02:00
"basedpyright",
2024-02-16 15:53:23 +01:00
}
2024-03-12 11:33:07 +01:00
2024-03-12 19:37:42 +01:00
for _, lsp in ipairs(server_with_settings) do
lspconfig[lsp].setup(lspsettings[lsp])
end