Skip to content

LSP: views, syntax tree, IR, generated output, call graph (specs/lsp/views.t27) #12252

Closed

Description

@gHashTag

Views: ask the server for a derived picture of the code and read it as text. rust-analyzer offers the syntax tree, HIR and MIR of any file; gopls opens the assembly and the call graph. t27 has parse, IR and generated Verilog, Zig, JS and Python; each should be one command away from the cursor. 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/lsp318.t27 (virtual documents through workspace/textDocumentContent) and specs/lsp/analysis.t27.

Prior art:

Boundary

  • specs/lsp/views.t27

User Scenarios

  • Given a spec is open, when the client sends t27/viewSyntaxTree with a range, then the answer is the tree for that range as indented text, one node per line with kind and span.
  • Given the cursor in a function, when the client sends t27/viewIr, then the answer is the compiler's IR for that function only.
  • Given a spec with a Verilog target, when the client opens t27-generated:/verilog/<path>, then the text is what t27c gen-verilog writes for it, and it refreshes after an edit.
  • Given the target the user asked for does not support the construct under the cursor, when the view is requested, then the answer says which construct and which target, and is not empty.
  • Given the user asks for the call graph, when t27/viewCallGraph runs, then the answer is the text form of t27c callgraph for this module.

Requirements

  • FR-001: The module MUST implement t27/viewSyntaxTree, t27/viewIr, t27/viewGenerated (target as parameter: verilog, zig, js, python, json), t27/viewCallGraph and t27/viewFileText, each returning plain text.
  • FR-002: Generated views MUST call the compiler's own generators through the snapshot and MUST NOT contain a second generator; the output MUST be byte-equal to the command-line generator's output for the same file, and a test compares them on 5 specs.
  • FR-003: Every view MUST be available both as a request and as a scheme of the virtual document service.
  • FR-004: Every view MUST carry a header line with the compiler version and the content hash of its input, so a stale view is recognisable.
  • FR-005: A view MUST be read-only and MUST say so in the response (readOnly: true).

Success Criteria

  • At least 20 tests in specs/lsp/views.t27 pass, run on the lab with t27c test-report (exit 0), including the byte-equality check on 5 specs.
  • The 5 specs and the generator command are named in the issue when it closes.
  • git diff --name-only master lists only specs/lsp/views.t27 (0 files in other languages).

Activity

  1. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec created: specs/lsp/views.t27 (typecheck OK, 1 test pass).

  2. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Reopened: closed as spec-only. A .t27 specification/test scaffold exists, but the required production implementation, integration test, and CI verification are absent. This issue remains open until the target component implements the specified behavior and evidence is provided.

  3. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    Spec exists and passes typecheck + tests. M7 milestone complete.

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