mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-23 04:37:37 +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
|
end
|
||||||
|
|
||||||
function M.config_lsp()
|
function M.config_lsp()
|
||||||
local language_servers = {
|
|
||||||
"bashls",
|
|
||||||
"gopls",
|
|
||||||
-- "pylsp",
|
|
||||||
"pyright",
|
|
||||||
-- "rust_analyzer",
|
|
||||||
"rls",
|
|
||||||
}
|
|
||||||
local lsp_config = require("lspconfig")
|
local lsp_config = require("lspconfig")
|
||||||
|
|
||||||
-- Maybe update capabilities
|
-- Maybe update capabilities
|
||||||
@ -97,20 +89,19 @@ function M.config_lsp()
|
|||||||
if utils.is_plugin_loaded("cmp-nvim-lsp") then
|
if utils.is_plugin_loaded("cmp-nvim-lsp") then
|
||||||
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities)
|
||||||
end
|
end
|
||||||
|
|
||||||
if utils.is_plugin_loaded("null-ls.nvim") then
|
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
|
end
|
||||||
|
|
||||||
for _, ls in ipairs(language_servers) do
|
lsp_config.bashls.setup{ capabilities=capabilities, on_attach=default_attach }
|
||||||
lsp_config[ls].setup{
|
lsp_config.gopls.setup{ capabilities=capabilities, on_attach=default_attach }
|
||||||
capabilities = capabilities,
|
lsp_config.pyright.setup{ capabilities=capabilities, on_attach=default_attach }
|
||||||
|
lsp_config.rls.setup{
|
||||||
|
capabilities=capabilities,
|
||||||
on_attach=default_attach,
|
on_attach=default_attach,
|
||||||
settings={
|
settings={
|
||||||
pylsp={
|
|
||||||
-- configurationSources = {"flake8"},
|
|
||||||
configurationSources = {"black"},
|
|
||||||
formatCommand = {"black"},
|
|
||||||
},
|
|
||||||
rust={
|
rust={
|
||||||
build_on_save = false,
|
build_on_save = false,
|
||||||
all_features = true,
|
all_features = true,
|
||||||
@ -118,7 +109,6 @@ function M.config_lsp()
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.config_lsp_saga()
|
function M.config_lsp_saga()
|
||||||
|
Loading…
Reference in New Issue
Block a user