fix(vim.lsp.enable): don't eagerly enable LSP configs during startup #33762

closes #33761

(cherry picked from commit 1fb0126a08)
This commit is contained in:
Phạm Bình An
2025-05-02 16:05:18 +07:00
committed by github-actions[bot]
parent 81233a41d7
commit 710d561f88

View File

@ -603,7 +603,9 @@ function lsp.enable(name, enable)
-- Ensure any pre-existing buffers start/stop their LSP clients.
if enable ~= false then
vim.api.nvim_command('doautoall nvim.lsp.enable FileType')
if vim.v.vim_did_enter == 1 then
vim.cmd.doautoall('nvim.lsp.enable FileType')
end
else
for _, nm in ipairs(names) do
for _, client in ipairs(lsp.get_clients({ name = nm })) do