/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { Disposable } from 'vs/base/common/lifecycle'; import { IExtensionRecommendationReson } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations'; export type ExtensionRecommendation = { readonly extensionId: string; readonly reason: IExtensionRecommendationReson; }; export abstract class ExtensionRecommendations extends Disposable { readonly abstract recommendations: ReadonlyArray; protected abstract doActivate(): Promise; private _activationPromise: Promise | null = null; get activated(): boolean { return this._activationPromise !== null; } activate(): Promise { if (!this._activationPromise) { this._activationPromise = this.doActivate(); } return this._activationPromise; } }