mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
show recommendation only there is reason
This commit is contained in:
@@ -494,8 +494,11 @@ export class ExtensionEditor extends EditorPane {
|
||||
reset(template.recommendation);
|
||||
const extRecommendations = this.extensionRecommendationsService.getAllRecommendationsWithReason();
|
||||
if (extRecommendations[extension.identifier.id.toLowerCase()]) {
|
||||
append(template.recommendation, $(`div${ThemeIcon.asCSSSelector(starEmptyIcon)}`));
|
||||
append(template.recommendation, $(`div.recommendation-text`, undefined, extRecommendations[extension.identifier.id.toLowerCase()].reasonText));
|
||||
const reasonText = extRecommendations[extension.identifier.id.toLowerCase()].reasonText;
|
||||
if (reasonText) {
|
||||
append(template.recommendation, $(`div${ThemeIcon.asCSSSelector(starEmptyIcon)}`));
|
||||
append(template.recommendation, $(`div.recommendation-text`, undefined, reasonText));
|
||||
}
|
||||
} else if (this.extensionIgnoredRecommendationsService.globalIgnoredRecommendations.indexOf(extension.identifier.id.toLowerCase()) !== -1) {
|
||||
append(template.recommendation, $(`div.recommendation-text`, undefined, localize('recommendationHasBeenIgnored', "You have chosen not to receive recommendations for this extension.")));
|
||||
}
|
||||
|
||||
@@ -480,7 +480,7 @@ export class ExtensionHoverWidget extends ExtensionWidget {
|
||||
|
||||
private getRecommendationMessage(extension: IExtension): string | undefined {
|
||||
const recommendation = this.extensionRecommendationsService.getAllRecommendationsWithReason()[extension.identifier.id.toLowerCase()];
|
||||
if (recommendation) {
|
||||
if (recommendation?.reasonText) {
|
||||
const bgColor = this.themeService.getColorTheme().getColor(extensionButtonProminentBackground);
|
||||
return `<span style="color:${bgColor ? Color.Format.CSS.formatHex(bgColor) : '#ffffff'};">$(${starEmptyIcon.id})</span> ${recommendation.reasonText}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user