- Node.js 24
- npm
- VS Code
- reqstool with LSP support:
pipx install "reqstool[lsp]"
git clone https://github.com/reqstool/reqstool-vscode
cd reqstool-vscode
npm installnpm run compilenpm run watchnpm run lintTwo options:
Option A — F5 (Extension Development Host)
npm run compile(ornpm run watchto recompile on change)- Press
F5in VS Code — a new Extension Development Host window opens with the extension loaded. - In the host window, open a workspace containing a
requirements.ymlfile.
Option B — Install the .vsix
Use this when you want to test the extension exactly as an end user would — installed into your main VS Code instance, not a sandboxed host. This is useful for testing activation, the LSP handshake, and UI behaviour against a real workspace.
-
Build the package:
npm run build
This compiles the TypeScript and produces
reqstool-0.1.0.vsixin the project root. -
Install it into VS Code:
code --install-extension reqstool-*.vsix -
Reload VS Code when prompted (or run Developer: Reload Window from the Command Palette).
-
Open a workspace that contains a
requirements.ymlfile — the extension activates automatically when that file is detected. -
To verify activation: open the Output panel (
Ctrl+Shift+U) and select reqstool from the dropdown. You should see LSP handshake messages.
Uninstall when done:
code --uninstall-extension reqstool.reqstoolNote: Option B installs the built output (
out/), not the TypeScript source. If you make code changes, re-runnpm run buildand reinstall the new.vsix. Option A (F5) is faster for iterative development sincenpm run watchrecompiles automatically.
npm run test-with-reportxvfb-run --auto-servernum npm run test:uiOr on a machine with a display:
npm run test:ui- Launch the extension via Option A (F5) or Option B (vsix install) above.
- Open a workspace containing a
requirements.ymlfile — the extension activates automatically. - Check Output → reqstool — LSP handshake messages should be visible.
- Hover over a
@Requirements("REQ-001")annotation in Python or Java — a tooltip should appear. - Press
Ctrl+Shift+Oin a requirements YAML file — the Outline view should show symbols. - Type
Reqin a YAML file — a snippet should appear in IntelliSense. - Introduce an unknown ID → the Problems panel should show a diagnostic.
- Open the Command Palette and run reqstool: Refresh.
- Temporarily rename the reqstool binary:
mv $(which reqstool) $(which reqstool).bak - Open VS Code with the extension loaded → expect an error notification with an Open Docs button.
- Restore:
mv $(which reqstool).bak $(which reqstool)
npm run buildThis produces a .vsix file in the project root.
The extension is a thin LSP client. All language intelligence (hover, completion, go-to-definition, outline, diagnostics) is handled server-side by reqstool lsp over stdio. The client only:
- Locates and starts the
reqstool lspprocess. - Registers the
reqstool.refreshcommand. - Provides YAML structural snippets.
Follow Conventional Commits for all commits.
All commits must include a DCO sign-off (git commit -s).
- Always work on a branch (never push directly to
main). - Open a pull request for all changes.
- PR titles must follow Conventional Commits.
No version is stored in package.json — the version is derived from the git tag at build time.
- Go to Actions → Release → Run workflow
- Enter the version (e.g.
1.2.3or1.2.3-rc.1)- Must be valid npm semver — no
vprefix PATCHfor bug fixes,MINORfor new features,MAJORfor breaking changes
- Must be valid npm semver — no
- Click Run workflow
Release workflow (workflow_dispatch)
├─ validates semver
├─ creates and pushes git tag
├─ generates changelog with git-cliff
└─ creates DRAFT GitHub Release with changelog body
↓
human reviews and edits the draft in the GitHub UI
↓ clicks Publish
└─ triggers Publish workflow (publish_vscode_ext.yml)
├─ check-release validates tag is valid npm semver
├─ build runs tests, builds VSIX
└─ publish stamps VSIX with tag version, publishes to VS Marketplace
The draft is the review gate — the marketplace publish only happens after you approve it.
| Event | check-release | build | dry-run | publish |
|---|---|---|---|---|
Push to main |
✓ | ✓ | ||
| Release published (via draft approval) | ✓ | ✓ | ✓ | |
workflow_dispatch |
✓ | ✓ |
Requires the VSCE_PAT secret to be configured in the repository.