LSP Server
The reqstool LSP server implements the Language Server Protocol for requirements, SVCs, and annotations across Python, Java, TypeScript, and JavaScript projects. Any LSP-compatible client can use it — IDEs, AI coding assistants (such as Claude Code or GitHub Copilot), and other tooling.
Starting the Server
Capabilities
Lifecycle
Document Synchronisation
Document Opened
LSP method: textDocument/didOpen
Publishes diagnostics for the opened document immediately.
Document Changed
LSP method: textDocument/didChange
Re-runs diagnostics on every content change event.
Workspace
Intelligence
Hover
LSP method: textDocument/hover
In source files: Markdown tooltip for @Requirements/@SVCs IDs — title, description, lifecycle, SVCs, implementation count, and an "Open Details" link. In reqstool YAML files: JSON Schema description for the hovered field.
Completion
LSP method: textDocument/completion
In source files: autocompletes requirement and SVC IDs inside @Requirements() and @SVCs()
annotations. Trigger characters: ", space, :.
In YAML files: completes enum values from the JSON Schema.
Go to Definition
LSP method: textDocument/definition
From a source annotation: jumps to the id: line in the YAML file.
From svcs.yml (on a requirement reference): jumps to the defining entry in requirements.yml.
From mvrs.yml (on an SVC reference): jumps to the defining entry in svcs.yml.
Document Symbols
LSP method: textDocument/documentSymbol
Outline view for reqstool YAML files. Requirements show linked SVCs as children; SVCs show requirements and MVRs as children.
Code Lens
LSP method: textDocument/codeLens
Inline summary above @Requirements/@SVCs annotations: SVC count and pass/fail verification results. Clicking opens the Details panel.
Inlay Hints
LSP method: textDocument/inlayHint
Appends the human-readable title of each requirement or SVC immediately after its ID in source annotations.
Find References
LSP method: textDocument/references
Finds all usages of a requirement or SVC ID across open source files and all reqstool YAML files in the project.
Workspace Symbols
LSP method: workspace/symbol
Global search across all loaded projects for requirements and SVCs matching the query string (by ID or title).
Custom Protocol
LSP method: reqstool/details
reqstool/details is not part of the standard LSP specification. It is a reqstool
extension understood only by reqstool-aware clients. Generic LSP clients will ignore it.
|
Custom LSP request. Fetches structured data for a single requirement, SVC, or MVR. Can drive e.g. a Details panel in an IDE. Searches all ready projects.
The full protocol spec (OpenRPC) is at docs/modules/ROOT/lsp/reqstool-lsp.openrpc.json.
Supported Annotation Languages
The server recognises @Requirements and @SVCs annotations in the following languages:
Python
Language IDs: python
@Requirements("REQ_010", "REQ_011")
@SVCs("SVC_010")
Uses the reqstool-python-decorators package. Multi-line annotations are supported.