-
-
Notifications
You must be signed in to change notification settings - Fork 4
feat: add vulnerability quick-fix + hint #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis pull request implements vulnerability code actions for the extension. It adds a new timeout constant for vulnerability fetches, integrates a code action provider in the main extension entry point, and creates a VulnerabilityCodeActionProvider that offers QuickFix actions to update package versions. The vulnerability diagnostic system is enhanced to extract fixed-in version information from API responses, determine the best available fixed version, and propagate this data through diagnostic messages and codes. The VulnerabilitySummary interface is extended with an optional fixedIn field to support this new functionality. Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/providers/code-actions/vulnerability.ts (1)
47-51: Minor: RedundantparseVersioncall onfixedInVersion.The
fixedInVersionextracted from the diagnostic code is already a raw semver string (e.g.,"16.1.5"), soparseVersion(fixedInVersion)?.semverwill return the same value. While this works correctly, it's slightly redundant.♻️ Optional simplification
const currentVersion = document.getText(diagnostic.range) const currentSemver = parseVersion(currentVersion)?.semver - const fixedSemver = parseVersion(fixedInVersion)?.semver ?? fixedInVersion - if (currentSemver && currentSemver === fixedSemver) + if (currentSemver && currentSemver === fixedInVersion) return []
Closes #24