Skip to content

Commit

Permalink
Install extension in the right server (#181110)
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 authored Apr 28, 2023
1 parent 0389468 commit e410e7c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ CommandsRegistry.registerCommand({
},
handler: async (accessor, arg: string | UriComponents, options?: { installOnlyNewlyAddedFromExtensionPackVSIX?: boolean; installPreReleaseVersion?: boolean; donotSync?: boolean; context?: IStringDictionary<any> }) => {
const extensionsWorkbenchService = accessor.get(IExtensionsWorkbenchService);
const extensionManagementService = accessor.get(IWorkbenchExtensionManagementService);
try {
if (typeof arg === 'string') {
const [id, version] = getIdAndVersion(arg);
Expand All @@ -338,6 +339,10 @@ CommandsRegistry.registerCommand({
installGivenVersion: !!version,
context: options?.context
};
if (extension.gallery && extension.enablementState === EnablementState.DisabledByExtensionKind) {
await extensionManagementService.installFromGallery(extension.gallery, installOptions);
return;
}
if (version) {
await extensionsWorkbenchService.installVersion(extension, version, installOptions);
} else {
Expand Down

0 comments on commit e410e7c

Please sign in to comment.