Repository navigation
Closed
Labels
area/specs.t27 spec files and conformance.t27 spec files and conformanceenhancementNew feature or requestNew feature or requestspec
Description
Code lens and runnables: clickable lines above declarations (Run test, 3 references, Show Verilog) and the list of things the user can run from here. Part of the LSP epic, Refs #12209 (wave 1, standard features). Only .t27: no code in any other language, not even scratch probes or a loader; see skill only-t27.
Depends on specs/lsp/index.t27 (reference counts). Commands travel through workspace/executeCommand in specs/lsp/workspace.t27.
Prior art:
- rust-analyzer
experimental/runnablesandexperimental/relatedTests, and lenses forRun,Debug,Implementationsand references: https://rust-analyzer.github.io/book/contributing/lsp-extensions.html - gopls code lenses: run test, run benchmark, regenerate, tidy, upgrade dependency, show compiler optimisation decisions: https://go.dev/gopls/
- HLS eval lens: https://haskell-language-server.readthedocs.io/en/latest/features.html
- LSP
textDocument/codeLens,codeLens/resolve,workspace/codeLens/refresh: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/
Boundary
- specs/lsp/lens.t27
User Scenarios
- Given a spec with 4
testblocks and 1bench, when the client sendstextDocument/codeLens, then every test has a lensRun test, the bench hasRun bench, and the module header hasRun all tests (4). - Given a function with 5 callers, when lenses are listed, then the lens title is
5 references, filled bycodeLens/resolveso the first answer is fast, and its command opens the references view at the function. - Given a spec that has a Verilog backend, when lenses are listed, then a lens
Show Verilogopens the generated text in a read-only view (the views are inspecs/lsp/views.t27). - Given a test finishes, when the lens is refreshed, then the lens shows
Run test (passed)orRun test (failed)from the last run. - Given a client without code lens support, when
initializearrives, then the capability is not announced.
Requirements
- FR-001: The module MUST list lenses for tests, benches, invariants, the module header, references, implementations of
@extern, and generated output, each lens kind behind its own switch. - FR-002: Lenses MUST be returned unresolved (range and
data) and resolved bycodeLens/resolvewith title and command. - FR-003: Commands MUST be plain command ids with arguments:
t27.runTest,t27.runAll,t27.showReferences,t27.showGenerated; the ids and argument shapes are constants in the module that the client generator reads. - FR-004: The module MUST keep the last result per test and MUST send
workspace/codeLens/refreshwhen a result changes. - FR-005: The module MUST list runnables as a custom request
t27/runnablesreturning the same items with their command lines, for clients that have no lens support.
Success Criteria
- At least 20 tests in
specs/lsp/lens.t27pass, run on the lab witht27c test-report(exit 0). - A test asserts that the first
codeLensanswer carries no title for the reference-count lens and that resolve fills it. git diff --name-only masterlists onlyspecs/lsp/lens.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).