diff options
author | kylo252 <[email protected]> | 2021-10-30 14:43:29 +0200 |
---|---|---|
committer | kylo252 <[email protected]> | 2021-10-30 14:44:24 +0200 |
commit | 17648e5a07f8c4fe851b09f3037db58c73fe292f (patch) | |
tree | 6ef8f701b823e5d4f61945142eb7ceec2581ead4 /lua/lvim/lsp/manager.lua | |
parent | 1f2167df0ea3f837c9c78a0137a888ca05e5e83a (diff) | |
parent | c4a85b32752e1ca41c6d9a2613b9d2e75dbf463d (diff) |
Merge branch 'rolling'
Diffstat (limited to 'lua/lvim/lsp/manager.lua')
-rw-r--r-- | lua/lvim/lsp/manager.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lua/lvim/lsp/manager.lua b/lua/lvim/lsp/manager.lua index 0b11c175..a8544803 100644 --- a/lua/lvim/lsp/manager.lua +++ b/lua/lvim/lsp/manager.lua @@ -26,8 +26,8 @@ local function resolve_config(name, user_config) capabilities = require("lvim.lsp").common_capabilities(), } - local status_ok, custom_config = pcall(require, "lvim.lsp/providers/" .. name) - if status_ok then + local has_custom_provider, custom_config = pcall(require, "lvim/lsp/providers/" .. name) + if has_custom_provider then Log:debug("Using custom configuration for requested server: " .. name) config = vim.tbl_deep_extend("force", config, custom_config) end @@ -70,7 +70,11 @@ function M.setup(server_name, user_config) if server_available and ensure_installed(requested_server) then requested_server:setup(config) else - require("lspconfig")[server_name].setup(config) + -- since it may not be installed, don't attempt to configure the LSP unless there is a custom provider + local has_custom_provider, _ = pcall(require, "lvim/lsp/providers/" .. server_name) + if has_custom_provider then + require("lspconfig")[server_name].setup(config) + end end end |