Conversation
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (2)
src/providers/diagnostics/rules/deprecation.ts (1)
25-29:⚠️ Potential issue | 🟡 MinorLink the deprecated version you actually reported.
The message is based on
resolvedVersion, but the target URL is still built fromresolvedSpec. For tags and ranges that can open a different release from the one marked as deprecated.💡 Suggested fix
code: { value: 'deprecation', - target: Uri.parse(npmxPackageUrl(resolvedName, resolvedSpec)), + target: Uri.parse(npmxPackageUrl(resolvedName, resolvedVersion)), },src/providers/hover/npmx.ts (1)
39-42:⚠️ Potential issue | 🟡 MinorLink provenance to the version you verified.
The provenance check is performed against
resolvedVersion, but the hover link still points atresolvedSpec. For tags and ranges that can open a different release from the one just marked as verified.💡 Suggested fix
const resolvedVersion = await dep.resolvedVersion() if (resolvedVersion && pkg.versionsMeta[resolvedVersion]?.provenance) // npmx.dev can resolve ranges and tags version specifier - md.appendMarkdown(`[$(verified)${SPACER}Verified provenance](${npmxPackageUrl(resolvedName, resolvedSpec)}#provenance)\n\n`) + md.appendMarkdown(`[$(verified)${SPACER}Verified provenance](${npmxPackageUrl(resolvedName, resolvedVersion)}#provenance)\n\n`)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 84201ddf-328e-411e-8c6d-479ab77f3841
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
package.jsonpnpm-workspace.yamlsrc/composables/workspace-context.tssrc/extractors/json.tssrc/providers/diagnostics/rules/deprecation.tssrc/providers/hover/npmx.tssrc/utils/ast.tssrc/utils/memoize.tssrc/utils/workspace.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- src/composables/workspace-context.ts
- src/utils/ast.ts
- package.json
- pnpm-workspace.yaml
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/utils/file.ts (1)
51-59:⚠️ Potential issue | 🟠 Major
readPackageManifest()no longer matches its declared contract.Line 54 casts raw
JSON.parse()output toPackageManifestInfo, even though that type now expects parsedDependencyInfo[]entries rather than the raw dependency object map frompackage.json. Lines 56-57 also still reject manifests withoutname/version, so this helper can now return either a structurally invalidPackageManifestInfoorundefinedfor manifests the new flow is meant to support; please either normalise through the JSON extractor or keep a separate raw-manifest type here.src/providers/diagnostics/index.ts (1)
55-57:⚠️ Potential issue | 🟠 Major
document.versionis not a sufficient collection token.The old
collect()/runRule()promises keep running in the background. When recollection is triggered by rule toggles or file-system events, the version stays unchanged, so an older pass can still flush diagnostics after a newer pass has cleared them. Please use a per-run generation id orAbortControllerinstead of relying ondocument.versionalone.Also applies to: 75-99, 105-123, 125-149
♻️ Duplicate comments (1)
src/providers/hover/npmx.ts (1)
39-42:⚠️ Potential issue | 🟡 MinorLink the exact version whose provenance was checked.
Line 40 verifies provenance on
resolvedVersion, but Line 42 still links toresolvedSpec. For ranges and tags, the hover can report one release as verified and open another.
🧹 Nitpick comments (1)
src/commands/open-file-in-npmx.ts (1)
44-45: Consider narrowing the return type ofreadPackageManifest()to eliminate the need for non-null assertions.Lines 44–45 are safe today because
readPackageManifest()guards against manifests withoutname/version, but the non-null assertions hide that contract from the type system. Returning a narrowed manifest type fromreadPackageManifest()(or adding a local type guard) would make this call site self-documenting and prevent future regressions if the helper changes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 663aa823-135a-46fa-b882-5377e344d1a1
📒 Files selected for processing (14)
src/commands/open-file-in-npmx.tssrc/composables/workspace-context.tssrc/data/extractors/index.tssrc/data/extractors/json.tssrc/data/extractors/yaml.tssrc/data/workspace.tssrc/providers/completion-item/version.tssrc/providers/diagnostics/index.tssrc/providers/diagnostics/rules/engine-mismatch.tssrc/providers/document-link/npmx.tssrc/providers/hover/npmx.tssrc/types/extractor.tssrc/utils/file.tstsconfig.json
🚧 Files skipped from review as they are similar to previous changes (1)
- tsconfig.json
| if (info.resolvedProtocol !== 'npm') | ||
| return |
There was a problem hiding this comment.
Keep catalog: and protocol aliases intact when inserting a version.
Line 18 now admits any dependency whose resolved protocol is npm, but the formatter in src/utils/version.ts:32-47 only re-attaches the declared protocol when resolvedName !== rawName. On catalog: or same-name npm: specs, accepting a completion here can overwrite the whole value with a bare range and silently break the manifest.
Also applies to: 39-42
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/data/extractors/yaml.ts (1)
21-24: Consider defensive handling for missingrangeproperty.The non-null assertion
node.range!assumes the range is always present. WhileparseDocumenttypically includes range information, this could fail if the YAML library's behaviour changes or if the node is synthetically created.🛡️ Optional defensive check
`#getScalarRange`(node: YamlNode): OffsetRange { - const [start, end] = node.range! - return [start, end] + const range = node.range + if (!range) + return [0, 0] + return [range[0], range[1]] }
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 81324241-571f-4f36-9ba4-200694a6a3ee
📒 Files selected for processing (3)
src/composables/workspace-context.tssrc/data/extractors/yaml.tssrc/data/workspace.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/composables/workspace-context.ts
# Conflicts: # eslint.config.js
WorkspaceContext, a per workspace-folder context that manages package manager detection, catalog loading, and dependency resolutionJsonExtractor/YamlExtractor, selected by file extension; extractors only parse raw dependency info.catalogssupport #56ResolvedDependencyInfofromWorkspaceContextnow.