- Node.js 22 or later
- .NET SDK 10.0 or later (for server publish)
- VS Code 1.96 or later
- Recommended VS Code extensions: ESLint (
dbaeumer.vscode-eslint), Prettier (esbenp.prettier-vscode)
src/VSCode/ ← this directory (TypeScript extension)
src/
extension.ts ← entry point (activate / deactivate)
projectManager.ts ← reqnroll/projectLoaded notifications
msbuildEvaluator.ts ← dotnet msbuild property evaluation
lspInspectorLogger.ts ← optional JSON-RPC file logger
statusBar.ts ← LSP server status bar item
syntaxes/ ← TextMate grammar (.tmLanguage.json)
scripts/
publish-server.sh ← publishes the LSP server for all RIDs
build-vsix.sh ← packages the .vsix
validate-semantic-token-scopes.mjs ← CI validation
tests/VSCode/ ← standalone Mocha test project (grammar + unit tests)
src/LSP/ ← the shared LSP server (C#)
package.json's activationEvents includes workspaceContains:**/*.feature in addition to
the more obvious onLanguage:gherkin. This is intentional, not left over: the step-usage-count
CodeLens (stepCodeLens.ts) needs the LSP client and ProjectManager running as soon as a
.cs file with step-definition CodeLenses is opened — which can happen before the user ever
opens a .feature file (onLanguage:gherkin wouldn't have fired yet). workspaceContains lets
the extension activate as soon as the workspace is known to be a Reqnroll project, independent
of which file the user opens first. Don't remove it without checking that CodeLens still shows
up on a .cs file opened before any .feature file.
The extension bundles the LSP server binary. For local development, publish it once:
cd src/VSCode
npm run build:serverThis runs scripts/publish-server.sh, which publishes the server for your host platform into src/VSCode/server/<rid>/.
cd src/VSCode
npm ciOpen the src/VSCode folder in VS Code. Press F5 to launch the Extension Development Host with the extension loaded. A new VS Code window will open with the extension active.
In a terminal:
cd src/VSCode
npm run watchThis keeps out/ up to date as you edit .ts files, so the Extension Development Host picks up changes on reload (Ctrl+R in the dev host window).
cd tests/VSCode
npm ci && npm testTests cover the TextMate grammar and utility functions. They run without VS Code.
cd src/VSCode
npm run lint
npm run format # write (auto-fix)
npm run format:check # check only (used in CI)cd src/VSCode
npm run build:vsixThis publishes the server for all four RIDs and packages the .vsix in one step. Requires Docker or cross-compilation support for non-host RIDs.
To see raw JSON-RPC traffic, open VS Code Settings and set:
reqnroll.trace.server: verbose
Traffic appears in the Output panel under Reqnroll LSP Trace. When set to verbose, a timestamped log file is also written to %LOCALAPPDATA%\Reqnroll\ (Windows) or ~/.local/share/Reqnroll/ (macOS/Linux).
Unlike the Visual Studio extension, VS Code doesn't spawn the server with --trace or
--protocol-log-level — reqnroll.trace.server is the one setting that drives both sides:
- The wire-level trace (
InitializeParams.Traceat startup,$/setTraceon later changes) is handled entirely byvscode-languageclientitself, via theLogOutputChannelreturned fromcreateTraceChannel()(src/lspInspectorLogger.ts) —offmaps tovscode.LogLevel.Off(client sendstrace: "off"), anything else tovscode.LogLevel.Trace(client sendstrace: "messages"/"verbose"matching the setting). No--traceCLI flag is involved. traceServerToLogLevel()(same file) separately maps the setting onto the server's--log-levelCLI argument passed inextension.ts(off→Warning,messages→Info,verbose→Verbose), so the same lever also controls the server's own file/protocol log verbosity.--protocol-log-levelis left at the server's own default (Warning) — there's no VS Code setting for it yet.
Changing reqnroll.trace.server requires a window reload to take effect on the already-running
server (the --log-level it maps to is fixed at process launch).
The GitHub Actions workflow .github/workflows/build-vscode-extension.yml runs on every push to feat/vscode-extension-** branches. It:
- Publishes the server for all four RIDs in parallel
- Compiles TypeScript, lints, format-checks, and validates semantic token scopes
- Packages the
.vsix