Skip to content

LSP: VS Code client generated from the client spec (specs/lsp/client.t27) #12266

Closed

Description

@gHashTag

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:

Boundary

  • specs/lsp/client.t27

User Scenarios

  • Given a workspace with .t27 files, when VS Code opens it, then the extension activates, starts t27c lsp on stdio, and the status bar shows the server state from specs/lsp/status.t27.
  • Given t27c is 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 View and T27: Run Check, when each runs, then it calls the matching t27/* request and shows the result in the right surface.
  • Given gen-js is run on the spec, when the output is built into the extension, then the extension package contains no hand-written .js or .ts source besides generated files named in the issue.

Requirements

  • FR-001: specs/lsp/client.t27 MUST describe activation, server launch, restart policy, commands, views, and status in t27, and MUST generate the extension entry through t27c gen-js (or gen-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.json contributions (commands, configuration keys, views) MUST be generated from the spec via gen-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.t27 pass, run on the lab with t27c 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 master lists only specs/lsp/client.t27 and generated files named in the issue (0 hand-written files in other languages).

Activity

  1. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec created: specs/lsp/vscode_client.t27 (typecheck OK, 1 test passes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/specs.t27 spec files and conformanceenhancementNew feature or requestspec

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions