mirror of
https://github.com/neovim/neovim.git
synced 2025-09-24 03:58:32 +00:00
fix(lsp): restore Client:stop() force-stopping behavior (#35800)
This fixes a regression from #33796.
I tried for several hours and cannot write a working test for this, but
this does fix the following warning in tests run with ASAN or TSAN:
-------- Running tests from test/functional/plugin/lsp_spec.lua
RUN T4667 LSP server_name specified start_client(), stop_client(): 114.00 ms OK
RUN T4668 LSP server_name specified stop_client() also works on client objects: 97.00 ms OK
RUN T4669 LSP server_name specified does not reuse an already-stopping client #33616: 31.00 ms OK
nvim took 2022 milliseconds to exit after last test
This indicates a likely problem with the test even if it passed!
(cherry picked from commit 4ef5624729
)
This commit is contained in:

committed by
github-actions[bot]
![github-actions[bot]](/assets/img/avatar_default.png)
parent
d86658f9d9
commit
eb4837206a
@@ -806,12 +806,12 @@ end
|
|||||||
---
|
---
|
||||||
--- @param force? boolean
|
--- @param force? boolean
|
||||||
function Client:stop(force)
|
function Client:stop(force)
|
||||||
if self:is_stopped() then
|
local rpc = self.rpc
|
||||||
|
if rpc.is_closing() then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
self._is_stopping = true
|
self._is_stopping = true
|
||||||
local rpc = self.rpc
|
|
||||||
|
|
||||||
vim.lsp._watchfiles.cancel(self.id)
|
vim.lsp._watchfiles.cancel(self.id)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user