mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 23:37:33 +00:00
Simplify lsp setup
This commit is contained in:
parent
9092219d2c
commit
371573e468
@ -82,14 +82,6 @@ local function default_attach(client, bufnr)
|
||||
end
|
||||
|
||||
function M.config_lsp()
|
||||
local language_servers = {
|
||||
"bashls",
|
||||
"gopls",
|
||||
-- "pylsp",
|
||||
"pyright",
|
||||
-- "rust_analyzer",
|
||||
"rls",
|
||||
}
|
||||
local lsp_config = require("lspconfig")
|
||||
|
||||
-- Maybe update capabilities
|
||||
@ -97,20 +89,19 @@ function M.config_lsp()
|
||||
if utils.is_plugin_loaded("cmp-nvim-lsp") then
|
||||
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
||||
end
|
||||
|
||||
if utils.is_plugin_loaded("null-ls.nvim") then
|
||||
table.insert(language_servers, "null-ls")
|
||||
M.config_null_ls()
|
||||
lsp_config["null-ls"].setup{ capabilities=capabilities, on_attach=default_attach }
|
||||
end
|
||||
|
||||
for _, ls in ipairs(language_servers) do
|
||||
lsp_config[ls].setup{
|
||||
lsp_config.bashls.setup{ capabilities=capabilities, on_attach=default_attach }
|
||||
lsp_config.gopls.setup{ capabilities=capabilities, on_attach=default_attach }
|
||||
lsp_config.pyright.setup{ capabilities=capabilities, on_attach=default_attach }
|
||||
lsp_config.rls.setup{
|
||||
capabilities=capabilities,
|
||||
on_attach=default_attach,
|
||||
settings={
|
||||
pylsp={
|
||||
-- configurationSources = {"flake8"},
|
||||
configurationSources = {"black"},
|
||||
formatCommand = {"black"},
|
||||
},
|
||||
rust={
|
||||
build_on_save = false,
|
||||
all_features = true,
|
||||
@ -119,7 +110,6 @@ function M.config_lsp()
|
||||
},
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
function M.config_lsp_saga()
|
||||
local saga = require("lspsaga")
|
||||
|
Loading…
Reference in New Issue
Block a user