From 684b7e75ea054a86a9381161e6be94914ad6c80e Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 28 May 2018 20:02:33 +0200 Subject: [PATCH] #45663 Get all asset types --- .../extensionManagement/common/extensionManagement.ts | 6 +++++- .../extensionManagement/node/extensionGalleryService.ts | 7 +++---- .../electron-browser/localizations.contribution.ts | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/vs/platform/extensionManagement/common/extensionManagement.ts b/src/vs/platform/extensionManagement/common/extensionManagement.ts index 27024e977b90a..fc19189018037 100644 --- a/src/vs/platform/extensionManagement/common/extensionManagement.ts +++ b/src/vs/platform/extensionManagement/common/extensionManagement.ts @@ -254,6 +254,10 @@ export enum InstallOperation { Update } +export interface ITranslation { + contents: { [key: string]: {} }; +} + export interface IExtensionGalleryService { _serviceBrand: any; isEnabled(): boolean; @@ -263,7 +267,7 @@ export interface IExtensionGalleryService { getReadme(extension: IGalleryExtension): TPromise; getManifest(extension: IGalleryExtension): TPromise; getChangelog(extension: IGalleryExtension): TPromise; - getCoreTranslations(extension: IGalleryExtension, languageId: string): TPromise<{}>; + getCoreTranslation(extension: IGalleryExtension, languageId: string): TPromise; loadCompatibleVersion(extension: IGalleryExtension): TPromise; loadAllDependencies(dependencies: IExtensionIdentifier[]): TPromise; getExtensionsReport(): TPromise; diff --git a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts index 377c1e25bb97c..92f6172726b8a 100644 --- a/src/vs/platform/extensionManagement/node/extensionGalleryService.ts +++ b/src/vs/platform/extensionManagement/node/extensionGalleryService.ts @@ -9,7 +9,7 @@ import * as path from 'path'; import { TPromise } from 'vs/base/common/winjs.base'; import { distinct } from 'vs/base/common/arrays'; import { getErrorMessage, isPromiseCanceledError } from 'vs/base/common/errors'; -import { StatisticType, IGalleryExtension, IExtensionGalleryService, IGalleryExtensionAsset, IQueryOptions, SortBy, SortOrder, IExtensionManifest, IExtensionIdentifier, IReportedExtension, InstallOperation } from 'vs/platform/extensionManagement/common/extensionManagement'; +import { StatisticType, IGalleryExtension, IExtensionGalleryService, IGalleryExtensionAsset, IQueryOptions, SortBy, SortOrder, IExtensionManifest, IExtensionIdentifier, IReportedExtension, InstallOperation, ITranslation } from 'vs/platform/extensionManagement/common/extensionManagement'; import { getGalleryExtensionId, getGalleryExtensionTelemetryData, adoptToGalleryExtensionId } from 'vs/platform/extensionManagement/common/extensionManagementUtil'; import { assign, getOrDefault } from 'vs/base/common/objects'; import { IRequestService } from 'vs/platform/request/node/request'; @@ -381,8 +381,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService { .withFlags(Flags.IncludeLatestVersionOnly, Flags.IncludeAssetUri, Flags.IncludeStatistics, Flags.IncludeFiles, Flags.IncludeVersionProperties) .withPage(1, pageSize) .withFilter(FilterType.Target, 'Microsoft.VisualStudio.Code') - .withFilter(FilterType.ExcludeWithFlags, flagsToString(Flags.Unpublished)) - .withAssetTypes(AssetType.Icon, AssetType.License, AssetType.Details, AssetType.Manifest, AssetType.VSIX, AssetType.Changelog); + .withFilter(FilterType.ExcludeWithFlags, flagsToString(Flags.Unpublished)); if (text) { // Use category filter instead of "category:themes" @@ -526,7 +525,7 @@ export class ExtensionGalleryService implements IExtensionGalleryService { .then(JSON.parse); } - getCoreTranslations(extension: IGalleryExtension, languageId: string): TPromise<{}> { + getCoreTranslation(extension: IGalleryExtension, languageId: string): TPromise { const asset = extension.assets.coreTranslations[languageId.toUpperCase()]; if (asset) { return this.getAsset(asset) diff --git a/src/vs/workbench/parts/localizations/electron-browser/localizations.contribution.ts b/src/vs/workbench/parts/localizations/electron-browser/localizations.contribution.ts index c571c09b1b256..c0880f84c9358 100644 --- a/src/vs/workbench/parts/localizations/electron-browser/localizations.contribution.ts +++ b/src/vs/workbench/parts/localizations/electron-browser/localizations.contribution.ts @@ -156,11 +156,11 @@ export class LocalizationWorkbenchContribution extends Disposable implements IWo return; } - this.galleryService.getCoreTranslations(extensionToFetchTranslationsFrom, locale) - .then(coreTranslation => { + this.galleryService.getCoreTranslation(extensionToFetchTranslationsFrom, locale) + .then(translation => { const translations = { ...minimumTranslatedStrings, - ...(coreTranslation ? coreTranslation['vs/platform/node/minimalTranslations'] : {}) + ...(translation && translation.contents ? translation.contents['vs/platform/node/minimalTranslations'] : {}) }; const logUserReaction = (userReaction: string) => { /* __GDPR__