Fix loading of lsp files on first load before install

This commit is contained in:
ViViDboarder 2021-12-16 20:51:46 -08:00
parent 718dcc79e6
commit d004dbee79

View File

@ -137,24 +137,25 @@ local function merged_capabilities()
end end
function M.config_lsp() function M.config_lsp()
local lsp_config = require("lspconfig") utils.try_require("lspconfig", function(lsp_config)
local capabilities = merged_capabilities() local capabilities = merged_capabilities()
-- Configure each server -- Configure each server
lsp_config.bashls.setup({ capabilities = capabilities, on_attach = default_attach }) lsp_config.bashls.setup({ capabilities = capabilities, on_attach = default_attach })
lsp_config.gopls.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.pyright.setup({ capabilities = capabilities, on_attach = default_attach })
lsp_config.rls.setup({ lsp_config.rls.setup({
capabilities = capabilities, capabilities = capabilities,
on_attach = default_attach, on_attach = default_attach,
settings = { settings = {
rust = { rust = {
build_on_save = false, build_on_save = false,
all_features = true, all_features = true,
unstable_features = true, unstable_features = true,
},
}, },
}, })
}) end)
end end
function M.config_lsp_saga() function M.config_lsp_saga()