language server: the first check of a document in slices #171
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
LANGUAGE-SERVER.md section 15, third bullet: the first check of a document, and one after a change of its interface, run as one step before the next message is read - two to four seconds for the largest file of the compiler when it is opened. The workspace check already takes slices of 40 ms (
ModuleRun,compiler/src/language-server/run.trb,beginModuleCheck/continueModuleCheck). Split from #10.Goal
Opening a document, or changing it in a way that needs a check as a whole (no mapping, or a body whose inferred result changed: sections 5 and 7), no longer blocks the server. The check of the document, and of the importers an interface change brings with it, runs in slices through a
ModuleRunbetween the messages; a request about a document whose check is pending waits for its last slice and is then answered exactly as today.Design record points (pinned)
$/cancelRequest); a request that takes steps is aRequestJob.Decisions this issue makes (inside the record, no owner question)
initialize,shutdown, formatting, document symbols (syntax only), and everything that does not need the check are answered at once. A waiting request can be cancelled like any job: it is answered with the cancel error the existing jobs use.frontOf, parsing and name resolution) is not sliced by this issue, and the PR measures and states how much of the open time it still is.Acceptance criteria
compiler/tests/language-server.test.trb, drivingstep) shows that a request about another document, sent after the open, is answered before the open's diagnostics are published.$/cancelRequestfor a waiting request answers it with the cancel error and leaves the check running.tests/lsp/*.expectedpass unchanged,tools/lsp.shincluded (tier A).compiler/src/semantics/checker/expression.trb) and the longest single step while it opens are measured on a binary built by the forge CI (not a gate) and written into section 15 / section 8; the third bullet of section 15 is removed.skills/, it is regenerated.Seed
No. Existing syntax;
ModuleRunand the checker'sbeginModuleCheckfamily exist already; no native, no flag.Size and commits
One PR, one or two Conventional Commits:
feat(lsp): check a document in slices between the messages, and optionallydocs(lsp): record the sliced check of a document. If the front turns out to need slicing too, that is a follow-up issue, not part of this PR. Tier A in the forge CI.Implementer
opus / high (language server core: server.trb job handling, run.trb, analysis.trb).
Collisions
Touches
server.trb,run.trb,analysis.trb,view.trb. #10 touchesanalysis.trbandview.trb: second to land rebases. #172 depends on this issue. No overlap with the running #6, #7, #9.[loop:torbscript] refine: split from #10 and made ready (acceptance criteria, pinned records, seed: no). Implementer: opus/high. Collides with #10 on analysis.trb and view.trb (second to land rebases); #172 depends on this issue, next: implement
[loop:torbscript] claim implement by session:loop-torbscript-20261008 until 2026-10-08T13:15:00Z
[loop:torbscript] release implement: the previous worker was killed (gateway restart) before pushing a branch, next: implement
[loop:torbscript] claim implement by session:loop-torbscript-20261008 until 2026-10-08T15:30:00Z
[loop:torbscript] claim review-fix by session:loop-torbscript-20261008 until 2026-10-08T18:40:00Z
[loop:torbscript] review-fix: rebased #188 onto main
4c6bbc40(head34db9908); conflicts incompiler/src/language-server/projects.trb(imports) anddocs/design/LANGUAGE-SERVER.mdsection 15,server.trbmerged cleanly with semantic tokens kept on the waiting path, andfinishChecknow drops the kept semantic tokens answer like the overlay path. PR mergeable, forge CI green: https://git.torb.dev/torbscript/language/actions/runs/250, review requested from argus. next: review