feat(completion): support 'npm:'-prefixed versions#29
Conversation
# Conflicts: # src/providers/diagnostics/rules/deprecation.ts # src/providers/hover/npmx.ts
📝 WalkthroughWalkthroughThis PR replaces legacy version-prefix helpers with a structured parsing/formatting flow: Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/providers/completion-item/version.ts (1)
35-50:⚠️ Potential issue | 🟠 MajorPreserve the
npm:protocol in completion insert text.
parseVersionnow carriesprotocol, but the completion item only usesprefix, so a dependency likenpm:^1.0.0would be replaced with^x.y.z, changing its meaning. Please reapply the protocol when building the insert text.🛠️ Suggested fix
- const { prefix } = parsed + const { prefix, protocol } = parsed + const protocolPrefix = protocol ? `${protocol}:` : '' const items: CompletionItem[] = [] for (const version in pkg.versionsMeta) { const meta = pkg.versionsMeta[version] @@ - const text = `${prefix}${version}` + const text = `${protocolPrefix}${prefix}${version}` const item = new CompletionItem(text, CompletionItemKind.Value)
Close #15