Vscode: Provide tool tip for TreeItem

Created on 4 Aug 2017  路  11Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.14.2
  • OS Version: Win10-x64

Steps to Reproduce:

  1. Use VSCode tree-view-sample
  2. Add tooltip to the initialization of the tree node via the _command_ object:
    https://github.com/Microsoft/vscode-extension-samples/blob/master/tree-view-sample/src/nodeDependencies.ts#L86-L93
super(label, collapsibleState);
// add code below
this.command = {
    command: 'vscode.open',
    title: 'test command',
    tooltip: 'My Tooltip.....',
    arguments: [Uri.file('some file')],
};
  1. Observe tooltips rendering item's title instead of the tooltip value.

It seems like there is no any work around for showing a custom tooltip for a tree-view extension.

explorer-custom feature-request on-testplan

Most helpful comment

Any way to get this bumped up -- I would love to be able to customize the tooltip of tree items. For example in GitLens, I truncate the tree item to not show the full commit message (because that would be nuts), but it would be great to have the tooltip contain the full message.

All 11 comments

@oleg-shilo Entries shown in the tree view correspond to the items contributed. They are not commands of the items. Hence the tooltip always show the title of the item. Item command is an action to be executed when user selects the item.

Sorry, I understand your logic but it's hard for me to see any valid reason for rejecting this issue.

I understand that the appearance and the action of the item are not the same thing. I appreciate that you may have reservations against reusing the "action tooltip" instead of an "item tooltip". But the truth is that the item just does not have an API for a tooltip. And this is the primary problem.

VSCode in all native tree-views does support visual paradigm allowing the item title and the tooltip to be different. See image below:

image

But the custom tree-view does not. And... there is no way around.

If you believe that tunneling the "action tooltip" is not the way then please consider reopening the issue as a feature request. I can create a separate dedicated feature request if it helps.

Thank you.

@oleg-shilo Good point. I agree that contributed item miss tooltip. Re-opening it.

Excellent. Thank you. The item is still closed though :)

Any way to get this bumped up -- I would love to be able to customize the tooltip of tree items. For example in GitLens, I truncate the tree item to not show the full commit message (because that would be nuts), but it would be great to have the tooltip contain the full message.

+1

Would also love this for the extension I鈥檓 working on.

@sandy081 Is this still meant for the January milestone? If not, can you move it to February milestone?

Noooo, not the backlog ;)

@eamodio I have to bring it up my backlog features in our planning meeting to commit for a milestone.

We have this feature for this milestone.

Hehe. Sweet - thank you!

Was this page helpful?
0 / 5 - 0 ratings