mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-04-27 16:55:44 +08:00
Update tree view sameple to include markdown tooltip
Part of https://github.com/microsoft/vscode/issues/120988
This commit is contained in:
@ -72,9 +72,11 @@ function getChildren(key: string): string[] {
|
||||
|
||||
function getTreeItem(key: string): vscode.TreeItem {
|
||||
const treeElement = getTreeElement(key);
|
||||
// An example of how to use codicons in a MarkdownString in a tree item tooltip.
|
||||
const tooltip = new vscode.MarkdownString(`$(zap) Tooltip for ${key}`, true);
|
||||
return {
|
||||
label: /**vscode.TreeItemLabel**/<any>{ label: key, highlights: key.length > 1 ? [[key.length - 2, key.length - 1]] : void 0},
|
||||
tooltip: `Tooltip for ${key}`,
|
||||
label: /**vscode.TreeItemLabel**/<any>{ label: key, highlights: key.length > 1 ? [[key.length - 2, key.length - 1]] : void 0 },
|
||||
tooltip,
|
||||
collapsibleState: treeElement && Object.keys(treeElement).length ? vscode.TreeItemCollapsibleState.Collapsed : vscode.TreeItemCollapsibleState.None
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user