mirror of
https://github.com/ViViDboarder/vim-settings.git
synced 2024-12-22 23:47:34 +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,28 +89,26 @@ 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 }
|
||||||
on_attach=default_attach,
|
lsp_config.rls.setup{
|
||||||
settings={
|
capabilities=capabilities,
|
||||||
pylsp={
|
on_attach=default_attach,
|
||||||
-- configurationSources = {"flake8"},
|
settings={
|
||||||
configurationSources = {"black"},
|
rust={
|
||||||
formatCommand = {"black"},
|
build_on_save = false,
|
||||||
},
|
all_features = true,
|
||||||
rust={
|
unstable_features = true,
|
||||||
build_on_save = false,
|
|
||||||
all_features = true,
|
|
||||||
unstable_features = true,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
end
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.config_lsp_saga()
|
function M.config_lsp_saga()
|
||||||
|
Loading…
Reference in New Issue
Block a user