Skip to content

Commit c470e57

Browse files
jeanp413corneliusludmann
authored andcommitted
Install extension with version using workbench.extensions.installExtension
1 parent 7358a2e commit c470e57

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vs/workbench/contrib/extensions/browser/extensions.contribution.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ import { ExtensionsCompletionItemsProvider } from 'vs/workbench/contrib/extensio
7474
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
7575
import { Event } from 'vs/base/common/event';
7676
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
77+
import { getIdAndVersion } from 'vs/platform/extensionManagement/common/extensionManagementCLIService';
7778

7879
// Singletons
7980
registerSingleton(IExtensionsWorkbenchService, ExtensionsWorkbenchService);
@@ -289,7 +290,8 @@ CommandsRegistry.registerCommand({
289290
const extensionGalleryService = accessor.get(IExtensionGalleryService);
290291
try {
291292
if (typeof arg === 'string') {
292-
const [extension] = await extensionGalleryService.getExtensions([{ id: arg }], CancellationToken.None);
293+
const [id, version] = getIdAndVersion(arg);
294+
const [extension] = await extensionGalleryService.getExtensions([{ id, version }], CancellationToken.None);
293295
if (extension) {
294296
await extensionManagementService.installFromGallery(extension, options?.donotSync ? { isMachineScoped: true } : undefined);
295297
} else {

0 commit comments

Comments
 (0)