mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix(lsp): schedule call to vim.lsp.start for async root_dir (#31998)
When `root_dir` is a function it can (and often will) call the provided callback function in a fast API context (e.g. in the `on_exit` handler of `vim.system`). When the callback function is executed we should ensure that it runs vim.lsp.start on the main event loop.
This commit is contained in:
@ -513,7 +513,9 @@ local function lsp_enable_callback(bufnr)
|
||||
---@param root_dir string
|
||||
config.root_dir(function(root_dir)
|
||||
config.root_dir = root_dir
|
||||
start(config)
|
||||
vim.schedule(function()
|
||||
start(config)
|
||||
end)
|
||||
end)
|
||||
else
|
||||
start(config)
|
||||
|
Reference in New Issue
Block a user