Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose & use TreeItem description and/or resourceUri through API for file differentiation #25

Closed
yozlet opened this issue Dec 18, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@yozlet
Copy link

yozlet commented Dec 18, 2018

I'm working on a project which has multiple folders below the project root, and each folder has its own tests.py. So my Test Explorer looks like this:
image
... which is not hugely helpful when trying to find the right one. (I'm using the Python Test Adapter, but this problem could apply to all of them.)

When dealing with multiple identically-named files, VSCode's practice is to differentiate on path by adding a smaller path description to tab headers:
image

Note that VSCode includes logic to work out the best text for these descriptions, based on where the paths differentiate.

These smaller, lighter/darker labels (a.k.a. Descriptions) are now available in extension tree views. You can provide the string for the description directly, or simply tell VSCode to work it out (using its path differentiation logic) from the TreeItem's resourceUri, which might be much easier.

@matepek
Copy link
Contributor

matepek commented Mar 21, 2019

I got a feature request: this
This is description related too.

I copy my proposal from a closed pull request:

Adding a description?: string to TestSuiteInfo, TestInfo, TestSuiteEvent and TestEvent.
Initially TreeItem#description is filled with TestSuiteInfo's and TestInfo's description if provided and could be overwritten by the event's description property if provided.

This case the adapter developer could choose how they wanna use the field.

(Maybe the tooltip property could be updated through events.)

Alternatively: having a description:string and durationInMiliSec:number field too and concatenating them on the test-explorer side.

@hbenl
Copy link
Owner

hbenl commented Mar 23, 2019

@matepek I just published a new version of Test Explorer and its API with the ability for adapters to set the description of tests and suites when loading and running. The tooltips can now also be changed when running.

@yozlet Since adapters can now set the descriptions, you should ask the developers of the Python adapter to add this feature. I also experimented with the possibility to let VS Code derive the descriptions from the resourceUri but I found the result not very convincing, that's why I decided it's probably not worth adding this special case to the Test Explorer.

@hbenl hbenl closed this as completed Mar 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants