feat: add vulnerability quick-fix + hint#39
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.
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