Skip to content

feat: add initial LSP client extension#1

Open
jimisola wants to merge 20 commits intomainfrom
feat/initial-lsp-client
Open

feat: add initial LSP client extension#1
jimisola wants to merge 20 commits intomainfrom
feat/initial-lsp-client

Conversation

@jimisola
Copy link
Member

Summary

  • Thin VSCode extension that delegates all language intelligence to the reqstool lsp server over stdio
  • Replaces the old reqstool-vscode-extension (deprecated) which used direct CLI invocation and custom hover providers
  • No WorkspaceManager, hoverProvider, WebViewProvider, or types.ts — the LSP server handles all of that

What's included

  • src/extension.ts — starts reqstool lsp, guards if not installed, registers reqstool.refresh command
  • src/snippets.ts — YAML structural snippets (Requirement, SVC, MVR) with tabstops and choice placeholders
  • src/test/ui/extension.ui.test.ts — UI tests (activation without errors, extension installed check)
  • src/test/fixtures/requirements.yml and test.code-workspace
  • .github/workflows/ — lint, build (installs reqstool before tests), semantic PR check, release check, publish
  • Full project scaffold: package.json, tsconfig.json, eslint.config.mjs, .vscode-test.mjs, .gitignore, .vscodeignore, .npmrc, renovate.json5
  • README.md and CONTRIBUTING.md

LSP features (no client-side code needed)

Feature VSCode UI
Hover Hover tooltip
Completion IntelliSense
Go to definition F12
Outline Native Outline view (Ctrl+Shift+O)
Diagnostics Problems panel
Refresh Command Palette → reqstool: Refresh

Test plan

  • npm install && npm run compile — zero errors
  • npm run lint — clean
  • npm run build — produces .vsix
  • Install .vsix, open a workspace with requirements.yml → extension activates
  • Hover over annotated identifier → tooltip appears
  • Ctrl+Shift+O in requirements YAML → Outline shows symbols
  • Command Palette → reqstool: Refresh → no error
  • Remove reqstool binary → error notification with Open Docs button appears

jimisola added 20 commits March 18, 2026 00:56
Thin VSCode extension that delegates all language intelligence
(hover, completion, go-to-definition, outline, diagnostics) to
the reqstool LSP server via stdio. Includes YAML snippets,
CI workflows, and UI tests.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Add skipLibCheck for vscode-jsonrpc type mismatch with TS 5.x,
and use explicit .js extension for Node16 module resolution.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
- Commit package-lock.json so CI can run npm ci
- Add .vscode/launch.json + tasks.json for F5 debug workflow
- Add headless smoke test (extension registered, refresh command registered)
- Handle rejected promise from reqstool.refresh sendRequest
- Expand CONTRIBUTING.md with Option A (F5) and Option B (vsix) local testing

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Without isTrusted = true, any command: links the LSP server
embeds in hover content (e.g. go-to-definition, quick-fix actions)
are silently stripped by VS Code and rendered as plain text.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
- reqstool.refresh: forwards to the LSP server's workspace/executeCommand
  so the Command Palette entry triggers a real project rebuild
- reqstool.openDetails: called from hover command: URI links; calls the
  custom reqstool/details LSP method and renders the result in a webview
- DetailsPanel (src/details.ts): singleton webview that renders
  requirement, SVC, and MVR details using VS Code theme variables;
  re-uses the same panel across invocations (reveal + update)
- package.json: adds reqstool.openDetails to contributes.commands

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…l (#314)

vscode-languageclient's ExecuteCommandFeature automatically registers
every command in the server's executeCommandProvider.commands. Manually
registering reqstool.refresh caused "command already exists" and crashed
the LSP client on startup.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
- Add defensive null check: if args.id or args.type are absent
  (e.g. invoked from Command Palette without args), show an info
  message and return instead of crashing with TypeError
- Hide reqstool.openDetails from the Command Palette via
  menus.commandPalette when:false — it is an internal command
  intended only for hover link invocation

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
- Fix lifecycle badge colors: effective/active = no badge, draft = blue,
  deprecated = orange, obsolete = red
- Add test summary (passed/failed/skipped) column to SVCs table in
  requirement details view
- Make SVC IDs in requirement details clickable: clicking opens the
  SVC details panel via postMessage → reqstool.openDetails command
- Enable scripts in details webview; update CSP accordingly

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…yling

- SVC details: REQ IDs and MVR IDs are now clickable links
- MVR details: SVC IDs are now clickable links
- REQ details: SVC IDs already clickable (prev commit)
- Replace svcDetailsLink with unified detailsLink(id, type) helper
- Add CSS for .cmd-link anchors using VS Code link color tokens

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…n file

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…ness

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…ifecycleIcon

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…settings

- Replace reqstool.serverPath (string) with reqstool.serverCommand (string[],
  default ["reqstool", "lsp"]) for full control over the LSP start command
- Add reqstool.startupTimeout (ms) to tune the server availability check
- Add reqstool.symbolLookupDelay (ms) to tune post-open symbol query delay
- Add reqstool.fileWatchPattern (glob) to customize watched YAML files
- Add reqstool.languages (checkbox list) to select active language IDs

Signed-off-by: jimisola <jimisola@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant