Repository navigation
Closed
Closed
Copy link
Labels
area/specs.t27 spec files and conformance.t27 spec files and conformanceenhancementNew feature or requestNew feature or requestspec
Description
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:
- rust-analyzer
viewSyntaxTree,viewHir,viewMir,viewFileText,viewCrateGraph,expandMacro: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html - gopls opens assembly and a web view of the call graph through
showDocument: https://go.dev/gopls/ - clangd
textDocument/ast: https://clangd.llvm.org/features
Boundary
- specs/lsp/views.t27
User Scenarios
- Given a spec is open, when the client sends
t27/viewSyntaxTreewith 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 whatt27c gen-verilogwrites 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/viewCallGraphruns, then the answer is the text form oft27c callgraphfor this module.
Requirements
- FR-001: The module MUST implement
t27/viewSyntaxTree,t27/viewIr,t27/viewGenerated(target as parameter: verilog, zig, js, python, json),t27/viewCallGraphandt27/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.t27pass, run on the lab witht27c 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 masterlists onlyspecs/lsp/views.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
Spec created: specs/lsp/views.t27 (typecheck OK, 1 test pass).
gHashTag commentedon Nov 17, 2026
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.
gHashTag commentedon Nov 17, 2026
Spec exists and passes typecheck + tests. M7 milestone complete.