Skip to content

Fix package.json version autocomplete for custom npm registries#314382

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-package-json-autocomplete-issue
Draft

Fix package.json version autocomplete for custom npm registries#314382
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-package-json-autocomplete-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 5, 2026

Since 1.117, npm view pack@latest fails silently for packages in custom registries (GitLab, Artifactory, etc.) that don't support @latest dist-tag resolution — causing zero version suggestions when editing package.json.

Changes

  • npmView: Falls back to npmViewFallback when npm view pack@latest returns nothing, instead of propagating the failure to npmjsView (which also fails for private-only packages)
  • npmViewFallback (new): Runs npm view pack dist-tags.latest description homepage — avoids @latest tag resolution and omits time to prevent fetching timestamps for every published version
  • runNpmCommand: Implements the ignoreError?: boolean parameter that was documented in its JSDoc but never wired up
  • npmListInstalledVersion: Uses ignoreError=truenpm ls exits non-zero on peer dependency issues even when the package is installed, previously hiding the installed version from hover tooltips

Copilot AI self-assigned this May 5, 2026
Copilot AI review requested due to automatic review settings May 5, 2026 13:15
Copilot AI review requested due to automatic review settings May 5, 2026 13:15
When npm view pack@latest fails for packages in custom registries (e.g.,
GitLab), fall back to npm view pack using dist-tags.latest to get the
latest version. Also implement the ignoreError parameter in runNpmCommand
and use it in npmListInstalledVersion so npm ls non-zero exit codes (e.g.
from peer dependency issues) don't hide the installed version.

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/23876571-d34b-4127-95dc-5b9ea680adf5

Co-authored-by: aeschli <6461412+aeschli@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 5, 2026 13:29
Copilot AI changed the title [WIP] Fix package.json version autocompletion for custom npm registries Fix package.json version autocomplete for custom npm registries May 5, 2026
Copilot AI requested a review from aeschli May 5, 2026 13:30
Copilot finished work on behalf of aeschli May 5, 2026 13:30
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Screenshot Changes

Base: 2493bf0b Current: c1391900

Changed (12)

chat/input/chatInput/Default/Dark
Before After
before after
chat/input/chatInput/Default/Light
Before After
before after
chat/input/chatInput/WithArtifacts/Dark
Before After
before after
chat/input/chatInput/WithFileChanges/Dark
Before After
before after
chat/input/chatInput/WithTodos/Dark
Before After
before after
chat/input/chatInput/WithTodos/Light
Before After
before after
chat/input/chatInput/WithTodosAndFileChanges/Dark
Before After
before after
chat/input/chatInput/WithArtifactsAndFileChanges/Light
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Dark
Before After
before after
chat/widget/chatWidget/PendingToolApproval/Light
Before After
before after
chat/widget/chatWidget/MultiTurn/Light
Before After
before after
agentSessionsViewer/NeedsInput/Light
Before After
before after

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

package.json doesn't autocomplete versions for packages from custom npm registries since 1.117

3 participants