feat(vscode-extension): improve UX/DX, add minSeverity config, and harden extension API stability#930
Merged
Gbangbolaoluwagbemiga merged 1 commit intoJun 25, 2026
Conversation
- Add `sanctifier.minSeverity` config (error|warning|information, default warning) so users control which severity levels appear as editor diagnostics - Expose a typed `SanctifierExtensionApi` from `activate()` (version + getFindings) for stable consumption by downstream extensions - Add persistent output channel for `analyzeWorkspace` results instead of opening an untitled document; CLI output streams there with debug context - Add `sanctifier.toggleEnable` command (status-bar clickable) and `sanctifier.showOutput` command for quick access to the log - Status bar item shows live finding count; clicking it toggles the extension - Add `filterBySeverity` / `SEVERITY_ORDER` utilities to analyzer module - Add content-change cache to skip re-analysis when document text is unchanged - Handle `onDidChangeWorkspaceFolders` to invalidate workspace detection cache - Extend test suite with 7 new tests covering filterBySeverity and SEVERITY_ORDER - Document the VS Code extension public API in DOCUMENTATION_INDEX.md
|
@Gbangbolaoluwagbemiga is attempting to deploy a commit to the gbangbolaoluwagbemiga's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@codemagician1949 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
9f1245a
into
HyperSafeD:main
21 of 24 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses the UX/DX gap in the
vscode-extensioncomponent, with particular focus on extension API stability (issue #621). The changes make the extension more predictable for users, composable for downstream extensions, and better aligned with VS Code best practices.Changes
sanctifier.minSeverityconfiguration (UX)A new setting lets users control which severity levels are surfaced as editor diagnostics:
Default is
"warning"— informational hints are suppressed unless explicitly opted in. TheanalyzeWorkspaceCLI command also forwards--min-severityso the output channel and the in-editor view stay consistent.Stable public extension API
activate()now returns a typedSanctifierExtensionApiobject that other extensions can consume:The interface is exported from
src/types.tsand versioned with the package.Output channel (DX)
analyzeWorkspaceno longer opens an untitled JSON document. Instead it streams to a persistent "Sanctifier" output channel that:Sanctifier: Show output channelcommandStatus bar + toggle command
Sanctifier: offSanctifier: Toggle enable/disable— flipssanctifier.enableglobally without opening settingsContent-change cache
runAnalysisnow skips re-parsing when the document text has not changed since the last run, reducing unnecessary work during cursor-only movements that triggeronDidChangeTextDocument.onDidChangeWorkspaceFoldershandlerWhen workspace folders are added/removed the workspace detection cache is invalidated and all open documents are rescheduled.
New
filterBySeverity/SEVERITY_ORDERutilities (analyzer.ts)These are pure functions that make severity filtering testable in isolation without a VS Code host.
Test suite extended (19 tests total, all passing)
Seven new tests cover
filterBySeverityandSEVERITY_ORDER:ranks information < warning < errorpasses all findings when minSeverity is informationdrops information-level findings when minSeverity is warningkeeps only errors when minSeverity is errorreturns empty array when no findings meet thresholdreturns empty array for empty inputCI
npm run lint(tsc --noEmit) — cleannpm test(compile + node --test) — 19/19 passnpx @vscode/vsce package— packages without warningsDocumentation
VS Code extension API surface documented in
DOCUMENTATION_INDEX.mdunder VS Code Extension.Closes #621
Closes #607
Closes #625
Closes #629