Path: blob/main/src/vs/workbench/contrib/extensions/browser/remoteRecommendations.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { ExtensionRecommendations, GalleryExtensionRecommendation } from './extensionRecommendations.js';6import { IProductService } from '../../../../platform/product/common/productService.js';7import { ExtensionRecommendationReason } from '../../../services/extensionRecommendations/common/extensionRecommendations.js';8import { PlatformToString, platform } from '../../../../base/common/platform.js';910export class RemoteRecommendations extends ExtensionRecommendations {1112private _recommendations: GalleryExtensionRecommendation[] = [];13get recommendations(): ReadonlyArray<GalleryExtensionRecommendation> { return this._recommendations; }1415constructor(16@IProductService private readonly productService: IProductService,17) {18super();19}2021protected async doActivate(): Promise<void> {22const extensionTips = { ...this.productService.remoteExtensionTips, ...this.productService.virtualWorkspaceExtensionTips };23const currentPlatform = PlatformToString(platform);24this._recommendations = Object.values(extensionTips).filter(({ supportedPlatforms }) => !supportedPlatforms || supportedPlatforms.includes(currentPlatform)).map(extension => ({25extension: extension.extensionId.toLowerCase(),26reason: {27reasonId: ExtensionRecommendationReason.Application,28reasonText: ''29}30}));31}32}33343536