Repository navigation
Description
The VS Code client for the t27 language server, written as a .t27 spec and generated, not hand-written. Today vscode-trinity-swe/ holds hand-written JavaScript (the syntax-highlighting fix in #12200 was grammar and icon data only). specs/lsp/client.t27 already describes the client side of the protocol; this issue makes it the source of the extension host code: it starts t27c lsp, wires the middleware, registers the t27/* commands and views, and shows status. The host code is t27c gen-js output. Part of the LSP epic, Refs #12209 (wave 4, clients). Only .t27: no code in any other language, not even scratch probes or a loader; see skill only-t27.
If gen-js cannot express a call the extension host needs (the vscode module's API, a child process, a webview), that is a compiler gap. File it on #5980 with a minimal .t27 repro and the issue shape, link it here, and stop; do not write the host in JavaScript.
Depends on specs/lsp/client.t27 as it stands, specs/lsp/main.t27 (the entry the client starts) and specs/lsp/config.t27 (the settings the client contributes).
Prior art:
- vscode-languageclient, the library that every VS Code extension for an LSP uses: https://github.com/microsoft/vscode-languageserver-node
- rust-analyzer's VS Code client: commands, status bar, test explorer, inlay hints: https://github.com/rust-lang/rust-analyzer/tree/master/editors/code
- vscode-lean4: infoview as a webview: https://github.com/leanprover/vscode-lean4
Boundary
- specs/lsp/client.t27
User Scenarios
- Given a workspace with
.t27files, when VS Code opens it, then the extension activates, startst27c lspon stdio, and the status bar shows the server state fromspecs/lsp/status.t27. - Given
t27cis not on the path, when the extension activates, then it shows one message with the setting that points to the binary and does not retry in a loop. - Given the server crashes, when it exits, then the client restarts it at most 3 times in 5 minutes and then stops with a message that includes the last stderr lines.
- Given the commands
T27: Restart Server,T27: Show Syntax Tree,T27: Open T27F ViewandT27: Run Check, when each runs, then it calls the matchingt27/*request and shows the result in the right surface. - Given
gen-jsis run on the spec, when the output is built into the extension, then the extension package contains no hand-written.jsor.tssource besides generated files named in the issue.
Requirements
- FR-001:
specs/lsp/client.t27MUST describe activation, server launch, restart policy, commands, views, and status in t27, and MUST generate the extension entry throught27c gen-js(orgen-ts); the generated file's path and the command are recorded in the issue. - FR-002: The client MUST pass only capabilities it implements in
initialize; a capability listed and not implemented is a test failure. - FR-003: The restart policy MUST be a pure function (count, window, last exit) with tests; the client MUST NOT busy-loop on a failing server.
- FR-004:
package.jsoncontributions (commands, configuration keys, views) MUST be generated from the spec viagen-json; none is hand-written. - FR-005: If any needed call is not expressible, the issue MUST end with a link to the t27c gap on epic: self-host t27c -- rewrite the compiler from Rust into t27 #5980 and the branch parked, not a foreign-language file.
Success Criteria
- At least 20 tests in
specs/lsp/client.t27pass, run on the lab witht27c test-report(exit 0), including the restart-policy table. - The generator runs on the lab and the generated extension loads in VS Code on the lab host; the command and the log line showing the server started are pasted in the issue. If not expressible, the epic: self-host t27c -- rewrite the compiler from Rust into t27 #5980 gap is linked instead.
git diff --name-only masterlists onlyspecs/lsp/client.t27and generated files named in the issue (0 hand-written files in other languages).
Activity
gHashTag commentedon Nov 17, 2026
Spec created: specs/lsp/vscode_client.t27 (typecheck OK, 1 test passes).