chore(nvim): remove server configurations for LSP

This commit is contained in:
Stefan Imhoff
2022-07-15 18:08:56 +02:00
parent 6c143ee251
commit 269aec7590

View File

@@ -1,47 +1,49 @@
local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer") local status_ok, lsp_installer = pcall(require, 'nvim-lsp-installer')
if not status_ok then if not status_ok then
return return
end end
local lspconfig = require("lspconfig") local lspconfig = require('lspconfig')
local servers = { local servers = {
"cssls", 'cssls',
"cssmodules_ls", 'diagnosticls',
"diagnosticls", 'emmet_ls',
"emmet_ls", 'pyright',
"graphql", 'sumneko_lua',
"pyright", 'tsserver',
"sumneko_lua",
"tsserver",
} }
lsp_installer.settings({ lsp_installer.settings(
ui = { {
icons = { ui = {
server_installed = "", icons = {
server_pending = "", server_installed = '',
server_uninstalled = "", server_pending = '',
}, server_uninstalled = '',
}, },
},
max_concurrent_installers = 4, max_concurrent_installers = 4,
}) }
)
lsp_installer.setup({ lsp_installer.setup(
ensure_installed = servers, {
}) ensure_installed = servers,
}
)
for _, server in pairs(servers) do for _, server in pairs(servers) do
local opts = { local opts = {
on_attach = require("kogakure.lsp.handlers").on_attach, on_attach = require('kogakure.lsp.handlers').on_attach,
capabilities = require("kogakure.lsp.handlers").capabilities, capabilities = require('kogakure.lsp.handlers').capabilities,
} }
local has_custom_opts, server_custom_opts = pcall(require, "kogakure.lsp.settings." .. server) local has_custom_opts, server_custom_opts = pcall(require, 'kogakure.lsp.settings.' .. server)
if has_custom_opts then if has_custom_opts then
opts = vim.tbl_deep_extend("force", opts, server_custom_opts) opts = vim.tbl_deep_extend('force', opts, server_custom_opts)
end end
lspconfig[server].setup(opts) lspconfig[server].setup(opts)
end end