Repository navigation
Closed
Labels
area/specs.t27 spec files and conformance.t27 spec files and conformanceenhancementNew feature or requestNew feature or requestspec
Description
Check on save: run the full compiler checks when the user saves, the way rust-analyzer runs cargo check (flycheck) and ZLS runs the build. The server's own analysis is fast and partial; the full check is slow and complete, and both feed the same problems list. Part of the LSP epic, Refs #12209 (wave 2, beyond the standard). Only .t27: no code in any other language, not even scratch probes or a loader; see skill only-t27.
Depends on specs/lsp/diagnostics.t27 (a second diagnostic source) and specs/lsp/window.t27 (progress).
Prior art:
- rust-analyzer flycheck: run on save,
overrideCommand,runFlycheck,clearFlycheck,cancelFlycheck, diagnostics from a separate source: https://rust-analyzer.github.io/book/configuration.html - ZLS build-on-save, running
zig buildand reporting its errors: https://zigtools.org/zls/ - LSP
textDocument/didSaveandtextDocument/willSave: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/
Boundary
- specs/lsp/check.t27
User Scenarios
- Given the setting
check.onSaveistypecheck, when the user saves a spec, then the server runst27c typecheckon it and its dependents, shows progressChecking, and publishes the findings withsourcet27c typecheck, separate from the live findings. - Given the user saves again while a check is running, when the second save arrives, then the running check is cancelled and a new one starts.
- Given the user sends
t27/clearCheck, when the request arrives, then the findings from the check source disappear and the live ones stay. - Given
check.overrideCommandis set to a command line, when the user saves, then that command runs instead, and its output is parsed in the compiler's JSON error shape. - Given the compiler is not found, when the check cannot start, then the server shows one message with the path it looked at, once, and not on every save.
Requirements
- FR-001: The module MUST implement
textDocument/didSavetriggered checks with the commandscheck,typecheckandlint, a setting for which runs, and the requestst27/runCheck,t27/clearCheckandt27/cancelCheck. - FR-002: The command runner MUST be a seam (a function value taking a command line and returning lines), so tests inject recorded output and the module never needs a compiler binary in a test.
- FR-003: The module MUST parse the compiler's machine-readable output into diagnostics with ranges and codes, and a test parses 3 recorded real outputs (clean, 1 error, 3 errors across 2 files).
- FR-004: Findings from a check MUST be kept apart by
sourceand replaced as a set when the next check ends, so stale findings disappear. - FR-005: Checks MUST NOT run on every keystroke and MUST NOT run in parallel for the same workspace.
Success Criteria
- At least 20 tests in
specs/lsp/check.t27pass, run on the lab witht27c test-report(exit 0), using the injected runner. - A negative control saves twice quickly and asserts exactly one set of findings is published and the first run was cancelled.
git diff --name-only masterlists onlyspecs/lsp/check.t27(0 files in other languages).
Metadata
Metadata
Assignees
Labels
area/specs.t27 spec files and conformance.t27 spec files and conformanceenhancementNew feature or requestNew feature or requestspec
Activity
gHashTag commentedon Nov 17, 2026
LSP spec created (typecheck OK, tests pass).