Enable synchronous API connections to existing servers - #64175
Draft
Jake Bailey (jakebailey) wants to merge 1 commit into
Draft
Enable synchronous API connections to existing servers#64175Jake Bailey (jakebailey) wants to merge 1 commit into
Jake Bailey (jakebailey) wants to merge 1 commit into
Conversation
Copilot started reviewing on behalf of
Jake Bailey (jakebailey)
September 4, 2026 21:24
View session
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The Unix client retains nonblocking FIFO descriptors, adding polling latency to synchronous requests.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds synchronous API connections to existing standalone and LSP servers using FIFOs on Unix and named pipes on Windows.
Changes:
- Adds selectable stdio, socket, and synchronous transports.
- Extends clients and VS Code integration with synchronous sessions.
- Adds cross-platform connection and cleanup tests.
File summaries
| File | Description |
|---|---|
tsc/internal/lsp/server.go |
Creates async or synchronous API sessions. |
tsc/internal/lsp/lsproto/lsp_generated.go |
Adds the synchronous request option. |
tsc/internal/lsp/lsproto/_generate/generate.mts |
Generates the new protocol field. |
tsc/internal/ipc/transport.go |
Adds cancellable transport acceptance. |
tsc/internal/ipc/transport_windows.go |
Uses named pipes for sync transport. |
tsc/internal/ipc/transport_unix.go |
Implements FIFO transport and cleanup. |
tsc/internal/api/server.go |
Generalizes server transport selection. |
tsc/cmd/tsc/api.go |
Adds the --transport option. |
packages/vscode-typescript/src/session.ts |
Forwards synchronous session requests. |
packages/vscode-typescript/src/extension.ts |
Exposes synchronous connection selection. |
packages/vscode-typescript/src/client.ts |
Sends the synchronous protocol field. |
packages/typescript/test/sync/connection.test.ts |
Tests standalone and LSP sync connections. |
packages/typescript/src/api/syncChannel.ts |
Connects sync channels to existing servers. |
packages/typescript/src/api/sync/client.ts |
Enables socket-style sync clients. |
packages/typescript/src/api/sync/api.ts |
Updates generated sync API documentation. |
packages/typescript/src/api/options.ts |
Documents transport-specific pipe behavior. |
packages/typescript/src/api/async/api.ts |
Updates connection documentation. |
Review details
Files not reviewed (1)
- tsc/internal/lsp/lsproto/lsp_generated.go: Generated file
- Files reviewed: 16/17 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+254
to
+255
| const readFd = probeReadFd; | ||
| const writeFd = probeWriteFd; |
Comment on lines
94
to
+95
| * The protocol is unversioned; both sides (this JS channel and the Go | ||
| * child process) must be built from the same tree. | ||
| * server must be built from the same tree. |
Allow the synchronous JavaScript API to attach to standalone and LSP-hosted API sessions without spawning another compiler process. Use FIFO pairs on Unix and named pipes on Windows, with cancellable setup and cleanup.
Jake Bailey (jakebailey)
force-pushed
the
redo-api-fifos
branch
from
September 4, 2026 21:58
77311ad to
23a1f25
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is some work I had back on the old repo that I've now brought back up to date.
Right now, you can only open an async connection with an existing server process. But, we can provide the sync API if we use FIFOs/named pipes; such a thing is not possible from Node as it irritatingly does not have
mkfifoor anything, but we can just do that on the Go side and then the API can talk to that instead, which to that process just looks like stdio.