Skip to content

Commit 4a6f814

Browse files
Add hover for description (microsoft#258873)
Fixes microsoft#258461
1 parent e9a4c07 commit 4a6f814

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/vs/platform/quickinput/browser/tree/quickInputTreeRenderer.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { Disposable, DisposableStore } from '../../../../base/common/lifecycle.j
1616
import { URI } from '../../../../base/common/uri.js';
1717
import { defaultCheckboxStyles } from '../../../theme/browser/defaultStyles.js';
1818
import { isDark } from '../../../theme/common/theme.js';
19+
import { escape } from '../../../../base/common/strings.js';
1920
import { IThemeService } from '../../../theme/common/themeService.js';
2021
import { IQuickTreeCheckboxEvent, IQuickTreeItem, IQuickTreeItemButtonEvent } from '../../common/quickInput.js';
2122
import { quickInputButtonToAction } from '../quickInputUtils.js';
@@ -109,6 +110,17 @@ export class QuickInputTreeRenderer<T extends IQuickTreeItem> extends Disposable
109110
const { labelHighlights: matches, descriptionHighlights: descriptionMatches, detailHighlights } = node.filterData || {};
110111

111112
// Label and Description
113+
let descriptionTitle: IManagedHoverTooltipMarkdownString | undefined;
114+
// NOTE: If we bring back quick tool tips, we need to check that here like we do in the QuickInputListRenderer
115+
if (quickTreeItem.description) {
116+
descriptionTitle = {
117+
markdown: {
118+
value: escape(quickTreeItem.description),
119+
supportThemeIcons: true
120+
},
121+
markdownNotSupportedFallback: quickTreeItem.description
122+
};
123+
}
112124
templateData.label.setLabel(
113125
quickTreeItem.label,
114126
quickTreeItem.description,
@@ -118,7 +130,8 @@ export class QuickInputTreeRenderer<T extends IQuickTreeItem> extends Disposable
118130
extraClasses: quickTreeItem.iconClasses,
119131
italic: quickTreeItem.italic,
120132
strikethrough: quickTreeItem.strikethrough,
121-
labelEscapeNewLines: true
133+
labelEscapeNewLines: true,
134+
descriptionTitle
122135
}
123136
);
124137

0 commit comments

Comments
 (0)