Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/extensions/browser/languageRecommendations.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { ExtensionRecommendations, ExtensionRecommendation } from './extensionRecommendations.js';
7
import { IProductService } from '../../../../platform/product/common/productService.js';
8
import { ExtensionRecommendationReason } from '../../../services/extensionRecommendations/common/extensionRecommendations.js';
9
10
export class LanguageRecommendations extends ExtensionRecommendations {
11
12
private _recommendations: ExtensionRecommendation[] = [];
13
get recommendations(): ReadonlyArray<ExtensionRecommendation> { return this._recommendations; }
14
15
constructor(
16
@IProductService private readonly productService: IProductService,
17
) {
18
super();
19
}
20
21
protected async doActivate(): Promise<void> {
22
if (this.productService.languageExtensionTips) {
23
this._recommendations = this.productService.languageExtensionTips.map((extensionId): ExtensionRecommendation => ({
24
extension: extensionId.toLowerCase(),
25
reason: {
26
reasonId: ExtensionRecommendationReason.Application,
27
reasonText: ''
28
}
29
}));
30
}
31
}
32
}
33
34