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
| The methods in this section are not part of the standard LSP specification. They are reqstool extensions understood only by reqstool-aware clients. Generic LSP clients will ignore them. |
reqstool/list
LSP method: reqstool/list
Returns lightweight lists of all requirements, SVCs, and MVRs in the first ready project. Accepts an optional urn to scope the result to a single project node.
Params: { "urn": "<urn>" } (optional)
Returns:
{
"requirements": [{ "id": "REQ_001", "title": "...", "lifecycle_state": "effective" }],
"svcs": [{ "id": "SVC_001", "title": "...", "lifecycle_state": "effective", "verification": "automated-test" }],
"mvrs": [{ "id": "MVR_001", "passed": true }]
}
reqstool/list-urns
LSP method: reqstool/list-urns
Returns all URNs in the loaded project graph with their metadata and resolved file paths.
Params: none
Returns: array of:
{
"urn": "my-service",
"variant": "microservice",
"title": "My Service",
"url": "https://github.com/example/my-service",
"location": { "type": "local", "uri": "/path/to/reqstool" },
"file_paths": {
"requirements": "/path/to/requirements.yml",
"svcs": "/path/to/software_verification_cases.yml"
}
}
reqstool/details
LSP method: reqstool/details
Fetches structured data for a single requirement, SVC, MVR, or URN. Can drive 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.
Params: { "type": "<type>", "id": "<id>" }
type |
id example |
Description |
|---|---|---|
|
|
Full requirement with linked SVCs, implementations, lifecycle, and test summary |
|
|
Full SVC with linked requirements, test annotations, test results, and MVRs |
|
|
Manual verification result with linked SVC IDs |
|
|
URN metadata, file paths, and entity counts |
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.