diff --git a/src/vs/platform/extensionManagement/common/extensionManagementCLIService.ts b/src/vs/platform/extensionManagement/common/extensionManagementCLIService.ts index 532a550c52a..acfde86cf11 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagementCLIService.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagementCLIService.ts @@ -10,11 +10,10 @@ import { URI } from 'vs/base/common/uri'; import { gt } from 'vs/base/common/semver/semver'; import { CLIOutput, IExtensionGalleryService, IExtensionManagementCLIService, IExtensionManagementService, IGalleryExtension, ILocalExtension, InstallOptions } from 'vs/platform/extensionManagement/common/extensionManagement'; import { adoptToGalleryExtensionId, areSameExtensions, getGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; -import { ExtensionType, EXTENSION_CATEGORIES, IExtensionManifest, isLanguagePackExtension } from 'vs/platform/extensions/common/extensions'; +import { ExtensionType, EXTENSION_CATEGORIES, IExtensionManifest } from 'vs/platform/extensions/common/extensions'; import { getBaseLabel } from 'vs/base/common/labels'; import { CancellationToken } from 'vs/base/common/cancellation'; import { Schemas } from 'vs/base/common/network'; -import { ILocalizationsService } from 'vs/platform/localizations/common/localizations'; const notFound = (id: string) => localize('notFound', "Extension '{0}' not found.", id); const useId = localize('useId', "Make sure you use the full extension ID, including the publisher, e.g.: {0}", 'ms-dotnettools.csharp'); @@ -47,8 +46,7 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer constructor( @IExtensionManagementService private readonly extensionManagementService: IExtensionManagementService, - @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService, - @ILocalizationsService private readonly localizationsService: ILocalizationsService + @IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService ) { } protected get location(): string | undefined { @@ -170,10 +168,6 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer } - if (installedExtensionsManifests.some(manifest => isLanguagePackExtension(manifest))) { - await this.updateLocalizationsCache(); - } - if (failed.length) { throw new Error(localize('installation failed', "Failed Installing Extensions: {0}", failed.join(', '))); } @@ -315,10 +309,6 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer } } - - if (uninstalledExtensions.some(e => isLanguagePackExtension(e.manifest))) { - await this.updateLocalizationsCache(); - } } public async locateExtension(extensions: string[], output: CLIOutput = console): Promise { @@ -335,11 +325,6 @@ export class ExtensionManagementCLIService implements IExtensionManagementCLISer }); } - - private updateLocalizationsCache(): Promise { - return this.localizationsService.update(); - } - private notInstalled(id: string) { return this.location ? localize('notInstalleddOnLocation', "Extension '{0}' is not installed on {1}.", id, this.location) : localize('notInstalled', "Extension '{0}' is not installed.", id); } diff --git a/src/vs/platform/localizations/common/localizations.ts b/src/vs/platform/localizations/common/localizations.ts index 27fa81bae5f..509c4ada830 100644 --- a/src/vs/platform/localizations/common/localizations.ts +++ b/src/vs/platform/localizations/common/localizations.ts @@ -25,8 +25,6 @@ export interface ILocalizationsService { readonly onDidLanguagesChange: Event; getLanguageIds(): Promise; - - update(): Promise; } export function isValidLocalization(localization: ILocalization): boolean { diff --git a/src/vs/workbench/api/browser/mainThreadCLICommands.ts b/src/vs/workbench/api/browser/mainThreadCLICommands.ts index 19fee9b47f9..0976a8ab5d3 100644 --- a/src/vs/workbench/api/browser/mainThreadCLICommands.ts +++ b/src/vs/workbench/api/browser/mainThreadCLICommands.ts @@ -15,7 +15,6 @@ import { getExtensionId } from 'vs/platform/extensionManagement/common/extension import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { ILabelService } from 'vs/platform/label/common/label'; -import { ILocalizationsService } from 'vs/platform/localizations/common/localizations'; import { IOpenerService } from 'vs/platform/opener/common/opener'; import { IProductService } from 'vs/platform/product/common/productService'; import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService'; @@ -85,11 +84,10 @@ class RemoteExtensionCLIManagementService extends ExtensionManagementCLIService @IProductService productService: IProductService, @IConfigurationService configurationService: IConfigurationService, @IExtensionGalleryService extensionGalleryService: IExtensionGalleryService, - @ILocalizationsService localizationsService: ILocalizationsService, @ILabelService labelService: ILabelService, @IWorkbenchEnvironmentService envService: IWorkbenchEnvironmentService ) { - super(extensionManagementService, extensionGalleryService, localizationsService); + super(extensionManagementService, extensionGalleryService); const remoteAuthority = envService.remoteAuthority; this._location = remoteAuthority ? labelService.getHostLabel(Schemas.vscodeRemote, remoteAuthority) : undefined; diff --git a/src/vs/workbench/api/node/extHostCLIServer.ts b/src/vs/workbench/api/node/extHostCLIServer.ts index 16059168daf..21f053df2ff 100644 --- a/src/vs/workbench/api/node/extHostCLIServer.ts +++ b/src/vs/workbench/api/node/extHostCLIServer.ts @@ -166,7 +166,6 @@ export class CLIServerBase { } private async manageExtensions(data: ExtensionManagementPipeArgs, res: http.ServerResponse) { - console.log('server: manageExtensions'); try { const toExtOrVSIX = (inputs: string[] | undefined) => inputs?.map(input => /\.vsix$/i.test(input) ? URI.parse(input) : input); const commandArgs = { @@ -175,12 +174,16 @@ export class CLIServerBase { uninstall: toExtOrVSIX(data.uninstall), force: data.force }; - const output = await this._commands.executeCommand('_remoteCLI.manageExtensions', commandArgs, { allowTunneling: true }); + const output = await this._commands.executeCommand('_remoteCLI.manageExtensions', commandArgs); res.writeHead(200); res.write(output); - } catch (e) { + } catch (err) { res.writeHead(500); - res.write(String(e)); + res.write(String(err), err => { + if (err) { + this.logService.error(err); + } + }); } res.end(); }