mirror of
https://github.com/neovim/neovim
synced 2025-07-15 16:51:49 +00:00
fix(lsp): ensure watcher cancel
* Cancel watcher in the "force" case. * Cancel watcher outside the async callback. It seems nvim doesn't wait async jobs on quitting, leaving detached inotifywait processes. * Clean up cancelling callbacks.
This commit is contained in:
committed by
Lewis Russell
parent
efe1732c6f
commit
9d9ee3476e
@ -174,6 +174,7 @@ function M.cancel(client_id)
|
||||
cancel()
|
||||
end
|
||||
end
|
||||
cancels[client_id] = nil
|
||||
end
|
||||
|
||||
return M
|
||||
|
@ -805,6 +805,8 @@ function Client:stop(force)
|
||||
return
|
||||
end
|
||||
|
||||
vim.lsp._watchfiles.cancel(self.id)
|
||||
|
||||
if force or not self.initialized or self._graceful_shutdown_failed then
|
||||
rpc.terminate()
|
||||
return
|
||||
@ -819,7 +821,6 @@ function Client:stop(force)
|
||||
rpc.terminate()
|
||||
self._graceful_shutdown_failed = true
|
||||
end
|
||||
vim.lsp._watchfiles.cancel(self.id)
|
||||
end)
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user