mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +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()
|
cancel()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
cancels[client_id] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
@ -805,6 +805,8 @@ function Client:stop(force)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
vim.lsp._watchfiles.cancel(self.id)
|
||||||
|
|
||||||
if force or not self.initialized or self._graceful_shutdown_failed then
|
if force or not self.initialized or self._graceful_shutdown_failed then
|
||||||
rpc.terminate()
|
rpc.terminate()
|
||||||
return
|
return
|
||||||
@ -819,7 +821,6 @@ function Client:stop(force)
|
|||||||
rpc.terminate()
|
rpc.terminate()
|
||||||
self._graceful_shutdown_failed = true
|
self._graceful_shutdown_failed = true
|
||||||
end
|
end
|
||||||
vim.lsp._watchfiles.cancel(self.id)
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user