Repository navigation
S4: language server in Track as trackc lsp - #37
Merged
Merged
Conversation
Adds compiler/src/lsp.trk, the track_stdin_read runtime primitive (C and Track runtimes), loader load_source, and the tests/lsp session runner. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fe reads - the --check child runs under exec timeout -k 1 $TRACKC_LSP_TIMEOUT (10s), with a watchdog fallback; a timeout publishes one diagnostic - the scratch dir is a kernel UUID made by mkdir -m 700 with its status checked; on failure diagnostics are off and one logMessage says so - a reaper removes the dir when the server dies without lsp_quit - a short body (raw NUL) gets a parse error instead of ending the server - C runtime file_read_all reads to EOF like rt_read_fd (procfs, pipes) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e_read_all) Built with TRACKC=<trackc from this tree> scripts/update_seed.sh: the old seed has no track_stdin_read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The native runtime sized reads by lseek, so read_text of /proc files was empty and the native trackc lsp could not make its scratch dir. The slow case grows to 12000 lets so the native checker also outlasts 1s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 22, 2026
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.
Third step of retiring Rust: the language server is ported from
src/lsp(Rust, tower-lsp) into trackc. The Rust server stays until S5 deletessrc/.What
compiler/src/lsp.trk. JSON-RPC 2.0 over stdio, with Content-Length framing (LF-only headers and extra headers are accepted), plus a small JSON reader and writer.main.trkonly gains thelspdispatch.fail_atexits and Track has no unwinding, so each check runs asexec timeout -k 1 $secs "/proc/$PPID/exe" lsp --check <tag>. The buffer is loaded under its real path, so imports resolve. Diagnostics are parsed back into LSP JSON. A checker crash becomes a diagnostic; it does not kill the server.TRACKC_LSP_TIMEOUT, default 10s. On timeout the server publishes "check timed out" and stays responsive, with no sh in between and no orphans./procUUID, created with checkedmkdir -m 700, and it fails closed. A reaper removes it on SIGTERM.track_stdin_read(n).file_read_allandrt_read_fdnow read to end of file instead of trusting ftell or lseek, so/procfiles work. As a side effect, reading a directory on the C backend no longer crashes; it returns "".TRACKCroute, because the runtime changed.update_seed.sh --checkpasses.tests/lsp/run.shruns 17 recorded sessions. They cover timeouts, planted symlinks, fail-closed and NUL bytes. The expected.outfiles are now committed;.gitignorehad been dropping them.trackc lsp.Checks
sh -claunch. It found two issues: no child timeout, and a guessable temp tag. Both are fixed in S4b./proc.PATH=/usr/bin:/binbootstraps from the new seed to the fixed point, and n2 = n3 = n4..outfile.check --deny-warningspassescargo testhas 0 failures🤖 Generated with Claude Code