⏪ Revert the LSP notes in testing.md
The protocol cross-link and the TS-internal shutdown-race explanation were too detailed for the category doc. The helper comment keeps a short, self-contained note on the stdin-EOF workaround.
This commit is contained in:
1 parent
eea2fbb17d
commit
947eac8089
2 files changed
+6
-15
No files matched your search
+3
-11
@@ -134,10 +134,7 @@ The script prints the labels the server offers at a `/*COMPLETE*/` marker inside
|
||||
is imported by `src/util/__tests__/lsp-completion.test.ts` — which tests the
|
||||
helper itself against inline documents, never the library's code — and by
|
||||
`src/primitive.test.ts`, where the same probe asserts the matcher's popup;
|
||||
the CLI is for manual inspection. It speaks to the server through
|
||||
`vscode-languageserver-protocol`'s message connection and typed requests, so the
|
||||
transport and protocol plumbing are not hand-rolled (see
|
||||
[tooling.md § `vscode-languageserver-protocol` backs the autocomplete helper](./tooling.md#vscode-languageserver-protocol-backs-the-autocomplete-helper)).
|
||||
the CLI is for manual inspection.
|
||||
|
||||
#### Why
|
||||
|
||||
@@ -165,13 +162,8 @@ transport and protocol plumbing are not hand-rolled (see
|
||||
any order; the file is an integration test (~1.6 s) that needs `node_modules`.
|
||||
`didOpen` is handled in order before the completion request, so no settle
|
||||
delay is needed.
|
||||
- The TS 7 Go server has a shutdown race: `handleExit` returns `io.EOF`, which
|
||||
cancels the background context while `Session.updateWatches` is still running
|
||||
(`internal/project/session.go`), so the bare `context canceled` error is
|
||||
flushed straight to stderr once the outgoing queue is closed, and the server
|
||||
exits 1 even though LSP expects 0 after `shutdown`. The helper therefore sends
|
||||
`shutdown` and then closes stdin instead of sending `exit`; EOF makes the
|
||||
server exit cleanly (code 0, no output), and the kill is kept as a fallback.
|
||||
- The server answers some requests with a string id (`client/registerCapability`);
|
||||
the client must tolerate `string | number` ids or the server stalls.
|
||||
|
||||
## Known issues
|
||||
|
||||
|
||||
@@ -145,10 +145,9 @@ export class LspSession {
|
||||
return (
|
||||
this.#connection
|
||||
.sendRequest(ShutdownRequest.type)
|
||||
// The TS 7 Go server races a background task against the `exit`
|
||||
// notification and logs a bare `context canceled` to stderr as it
|
||||
// tears down (see development/testing.md § Autocomplete). EOF on
|
||||
// stdin shuts it down cleanly instead: exit 0, no output.
|
||||
// The TS 7 Go server logs a bare `context canceled` to stderr
|
||||
// when it handles `exit`; EOF on stdin shuts it down cleanly
|
||||
// (exit 0, no output) instead.
|
||||
.then(() => {
|
||||
this.#child.stdin.end();
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user