Repository navigation
Refactor the LSP socketpair into build-tagged files - #107
Merged
Merged
Conversation
lspSocketpair calls syscall.Socketpair, which does not exist on Windows, so idelsp fails to compile there (unstablebuild#68). Move it into a !windows file unchanged. On Windows it returns an explicit "not supported yet" error instead: the transport also depends on net.FileConn and on passing one bidirectional handle as the server's stdin and stdout, neither of which carries over, so a real Windows transport is a separate change. Starting a language server then fails with that error rather than the package failing to build. Linux and macOS are unchanged; TestLSPSocketpairIsCloseOnExec still covers the unix implementation. Signed-off-by: Eric Brooks <[email protected]>
This was referenced Sep 18, 2026
ernestrc
approved these changes
Sep 20, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
ernestrc
added a commit
that referenced
this pull request
Sep 30, 2026
Part of Windows support (#68, coordinated on #81). Third slice; graphics stay with #82. Four call sites built `syscall.SysProcAttr` literals with `Setpgid`, `Setsid` and `Setctty`, and the file scheme killed process groups with `syscall.Kill`. None of these exist on Windows, so `workspace`, `workspacerpc`, `extensionv2`, `idedebug` and `vte` fail to compile there. This collects them in a small `internal/procattr` package: `NewGroup`, `NewSession`, `LeadsGroup`, `KillGroup` and `Signal`. The unix implementations are the old code moved unchanged, including `killProcessGroup` from the file scheme. On Windows a new group is `CREATE_NEW_PROCESS_GROUP`, a group is killed with `taskkill /T /F` (which walks the process tree, with "not found" mapped to `os.ErrProcessDone` like `ESRCH` on unix), sessions and controlling terminals do not exist, and `Signal` supports `SIGKILL` only. Linux and macOS are unchanged: the existing process-group tests in `file_scheme_test` and `workspace_runner_test` pass as before, and new tests pin that the helpers build exactly the attributes the literals built. The Windows-tagged tests cover the `taskkill` arguments and the group check; `GOOS=windows go vet ./internal/procattr/` passes. `idelsp`'s single `Setpgid` literal is deliberately left alone here because #107 touches the same file's imports; it becomes a one-line follow-up once both land. Signed-off-by: Eric Brooks <[email protected]> Signed-off-by: ernestrc <[email protected]> Co-authored-by: ernestrc <[email protected]>
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.
Part of Windows support (#68, coordinated on #81). Second small slice moving unix-only syscalls
behind build tags; graphics stay with #82.
lspSocketpaircallssyscall.Socketpair, which does not exist on Windows, soidelspfails tocompile there. The unix implementation moves into a
!windowsfile unchanged.On Windows it returns an explicit "language servers are not supported on Windows yet" error
instead of the package failing to build. The transport also depends on
net.FileConnand onhanding the server one bidirectional handle as its stdin and stdout, neither of which carries over
to Windows, so a real Windows transport (loopback pair with piped stdio) is a separate change.
Linux and macOS are unchanged;
TestLSPSocketpairIsCloseOnExecstill pins the uniximplementation. After this, the package's only remaining Windows compile error is the
Setpgidprocess-group attribute, which the next slice handles.