mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 17:28:23 +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!
This commit is contained in:
@@ -867,12 +867,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
|
|
||||||
|
|
||||||
lsp._watchfiles.cancel(self.id)
|
lsp._watchfiles.cancel(self.id)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user