Repository navigation
test: match language client stop errors by code across the extension bundle - #1957
Conversation
renkun-ken
left a comment
There was a problem hiding this comment.
Reviewed commit f9061b8. No actionable findings.
Matching PendingResponseRejected by code correctly handles the extension bundle's separate ResponseError constructor while retaining the Error and State.Stopped guards. The new regression fixture fails with the original helper and passes with this change; I also confirmed the same behavior with an actual separately bundled vscode-jsonrpc ResponseError. Existing rejection handling still propagates unrelated failures and errors from unstopped clients.
Validation: compilation, TypeScript checks, changed-file lint/format checks, and all four focused Interactive language client cleanup tests passed locally on macOS with VS Code 1.145.2. Hosted Windows and Ubuntu extension tests, all three Node jobs, and build/lint/format/typecheck checks have passed. The macOS extension job is still in progress at review time.
The Interactive editor suite's
suiteTeardownfailed on Windows with "Pending response rejected since connection got disposed" while stopping language clients.stopLanguageClientalready accepts this error when the client has stopped, but it matched it withinstanceof ResponseError. The clients under test come from the extension bundle, which includes its own copy of vscode-languageclient, so theirResponseErroris a different class from the one the test imports and the check never matched. It now matches the error code instead. A new test rejects a stop with an error of another class that carries the same code.