Skip to content

fix: correctly pass extension's id when version is also provided#279630

Merged
sandy081 merged 2 commits intomicrosoft:mainfrom
daiyam:fix-install-extension-version
Dec 16, 2025
Merged

fix: correctly pass extension's id when version is also provided#279630
sandy081 merged 2 commits intomicrosoft:mainfrom
daiyam:fix-install-extension-version

Conversation

@daiyam
Copy link
Contributor

@daiyam daiyam commented Nov 26, 2025

Hi,

When calling the workbench.extensions.installExtension command to install the extension dbaeumer.vscode-eslint@2.4.4,

  • the arg argument is split as [id, version] with:

const [id, version] = getIdAndVersion(arg);

  • then, the extensionsWorkbenchService.install function is called with:
    • currently, arg (dbaeumer.vscode-eslint@2.4.4)
    • with this PR, id (dbaeumer.vscode-eslint)

The install function is expecting an id:

installableInfo = { id: arg, version: installOptions.version, preRelease: installOptions.installPreReleaseVersion ?? this.extensionManagementService.preferPreReleases };

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the workbench.extensions.installExtension command where the extension ID with version (e.g., dbaeumer.vscode-eslint@2.4.4) was being passed to extensionsWorkbenchService.install() instead of just the ID (e.g., dbaeumer.vscode-eslint). The fix ensures that after splitting the argument into ID and version, only the ID is passed to the install function, while the version is passed separately in the options object.

Key Changes:

  • Fixed the workbench.extensions.installExtension command to pass only the extension ID to extensionsWorkbenchService.install() when a version is specified, instead of passing the full argument with version.

@sandy081 sandy081 added this to the December / January 2026 milestone Dec 9, 2025
@sandy081 sandy081 enabled auto-merge (squash) December 9, 2025 14:40
@sandy081 sandy081 merged commit acecfb1 into microsoft:main Dec 16, 2025
17 checks passed
@daiyam daiyam deleted the fix-install-extension-version branch December 16, 2025 10:30
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jan 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants