question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow TreeItem.label to support MarkdownString

See original GitHub issue

Looking at the API for TreeItemLabel it seems a bit limited. I’m trying to avoid moving to a webview view and what I need is some way to have certain nodes in a tree view be crossed out. It’d be nice if TreeItem.label could be extended to support MarkdownString.

Proposal:

export class TreeItem {
		/**
		 * A human-readable string describing this item. When `falsy`, it is derived from [resourceUri](#TreeItem.resourceUri).
		 */
		label?: string | TreeItemLabel | MarkdownString;
}

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:26
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
lukaschneidercommented, Feb 5, 2021

Hey, I am currently working on an extension which enables a user to open packet traces in vscode. While prototyping I came across this issue.

Having an option to use a monospaced font would improve readability a lot in my case.

Before: before

After: after

1reaction
P403n1x87commented, Jul 11, 2021

It would be nice if colours were supported too, but I believe this not something that could be achieved with a MarkdownString? Would it make sense to have a way to bypass escaping when setting the label value and allow nested span objects?

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code API | Visual Studio Code Extension API
A debug configuration provider allows to add debug configurations to the debug service and to resolve launch configurations before they are used to...
Read more >
ARIA: treeitem role - Accessibility - MDN Web Docs - Mozilla
A treeitem is an item in a tree. ... from the treeitem 's contents. The accessible name can also be set via aria-label...
Read more >
vscode.TreeItem - Haxe externs for Visual Studio Code
If not provided, an id is generated using the tree item's label. Note that when labels change, ids will change and that selection...
Read more >
react-vscode - npm
This package allows you to write TreeViews in React. ... <TreeItem label="first top-level" initiallyExpanded> <SomeThings /> </TreeItem> ) ...
Read more >
vscode TreeDataProvider TypeScript Examples
extractTextFromType(currentFile.type); return { iconPath: iconUri, label: ... getTreeItem(element: MenuItem): TreeItem { let iconPath: vscode.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found