mirror of
https://github.com/neovim/neovim.git
synced 2026-04-20 06:20:53 +00:00
revert: "fix(lsp): only resolve LSP configs once" #38990
reverteb90f5d9e3(cherry picked from commit4eb95c8ed2)
This commit is contained in:
committed by
github-actions[bot]
parent
6250019537
commit
5920a1d07f
@@ -604,7 +604,6 @@ function lsp.enable(name, enable)
|
||||
validate('name', name, { 'string', 'table' })
|
||||
|
||||
local names = vim._ensure_list(name) --[[@as string[] ]]
|
||||
local configs = {} --- @type table<string,{resolved_config:vim.lsp.Config?}>
|
||||
|
||||
-- Check for errors, and abort with no side-effects if there is one.
|
||||
for _, nm in ipairs(names) do
|
||||
@@ -615,13 +614,13 @@ function lsp.enable(name, enable)
|
||||
-- Raise error if `lsp.config[nm]` raises an error, instead of waiting for
|
||||
-- the error to be triggered by `lsp_enable_callback()`.
|
||||
if enable ~= false then
|
||||
configs[nm] = { resolved_config = lsp.config[nm] }
|
||||
_ = lsp.config[nm]
|
||||
end
|
||||
end
|
||||
|
||||
-- Now that there can be no errors, enable/disable all names.
|
||||
for _, nm in ipairs(names) do
|
||||
lsp._enabled_configs[nm] = enable ~= false and configs[nm] or nil
|
||||
lsp._enabled_configs[nm] = enable ~= false and {} or nil
|
||||
end
|
||||
|
||||
if not next(lsp._enabled_configs) then
|
||||
|
||||
Reference in New Issue
Block a user