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

Display coverage percentage next to files in the file explorer #151

Open
AlCalzone opened this issue Jul 26, 2018 · 11 comments
Open

Display coverage percentage next to files in the file explorer #151

AlCalzone opened this issue Jul 26, 2018 · 11 comments

Comments

@AlCalzone
Copy link

When opening a coverage report, e.g. from nyc, I first get an overview of coverage for files and folders. It would be nice to see this percentage next to the files in the file explorer (if that is even possible).

@ryanluker
Copy link
Owner

ryanluker commented Jul 27, 2018

@AlCalzone thanks for submitting an issue. Other then the make your own tree view (https://github.com/Microsoft/vscode-extension-samples/tree/master/tree-view-sample) I do not know of a way to add to the existing file explorer, myself but I will ask the vscode dev slack group and see if anyone knows more 😄 .

@ryanluker
Copy link
Owner

@AlCalzone looked a little further and got some feedback from the slack channel, microsoft/vscode#54938 it is coming eventually so in the future something like the could be added 😄

@ryanluker ryanluker changed the title Is it possible to display coverage percentage next to files in the file explorer? Display coverage percentage next to files in the file explorer Jul 27, 2018
@tenninebt
Copy link

tenninebt commented May 13, 2020

For the ones who want to have a solution in the mean time, I've created an extension that adds a TreeView to the Test Explorer, it is pretty basic, and in experimental state (Not unit tested, not published...) but I'm using it within a Flutter project. I needed an easy way to visualise my coverage and navigate it.
Please be indulgent as it is my first extension and written as a draft.

https://github.com/tenninebt/vscode-koverage

@ryanluker
Copy link
Owner

@tenninebt thanks for bringing your extension up! looks cool for a first stab at extension building 😁.
I also need to convert this project to webpack eventually as well so it was good to see how you implemented that.

@MalachiMackie
Copy link

@ryanluker looks like the vscode issue you linked to has been resolved. Is it possible to look at this again?

@ryanluker
Copy link
Owner

ryanluker commented Aug 1, 2022

@MalachiMackie Thanks for the ping! We can definitely take another look at implementing this for sure.

@GitMensch
Copy link

If it shows out that it still doesn't work by means of vscode, then integrating koverage tenninebt/vscode-koverage#24 may be a good solution.

@mendeljacks
Copy link

Idea to use vscode.FileDecorationProvider:

  • Vs code offers the ability to decorate the file tree explorer view with badges and colors
  • Badge seems to allow two characters so we can show percentage rounded
  • Color threshold can be set by the user in the extension settings

image

@ryanluker
Copy link
Owner

Idea to use vscode.FileDecorationProvider:

* Vs code offers the ability to decorate the file tree explorer view with badges and colors

* Badge seems to allow two characters so we can show percentage rounded

* Color threshold can be set by the user in the extension settings

image

Nice! That would work well, thanks for the mockup too!

@AlefCS
Copy link

AlefCS commented Dec 18, 2024

@ryanluker I read the comments on this issue and it seems to me that you are willing to go on with the file explorer decoration (btw I'm kind of curious to know how the 100% coverage would be like, since it only supports 2 characters 😄). But nowadays VSCode has its own Testing view with a tree like view for coverage and it seems to me that what it needs is "just" an extension to feed with the proper information. So wouldn't it be better to use the proper VSCode coverage view, instead of creating a new one over the file explorer?

@ryanluker
Copy link
Owner

ryanluker commented Jan 5, 2025

(btw I'm kind of curious to know how the 100% coverage would be like, since it only supports 2 characters 😄).

Interesting! Not sure what we would use, maybe ** or some other symbol character?

But nowadays VSCode has its own Testing view with a tree like view for coverage and it seems to me that what it needs is "just" an extension to feed with the proper information. So wouldn't it be better to use the proper VSCode coverage view, instead of creating a new one over the file explorer?

Woah, I am all for using Microsoft provided functionality, I will have to look into this!
(I assume this is the testing view you are talking about?)

So wouldn't it be better to use the proper VSCode coverage view, instead of creating a new one over the file explorer?

100% agree, only benefit might be older vscode editor versions without this feature, but I think most developers keep vscode very much near to latest and greatest 🤔.

----- EDIT -----
Oh nevermind I found the link to the feature here! It also seems to support gutter visualizations, which would be an alternative to this extension! (More coverage visualization the better in my opinion! Even if it might reduce the need for this extension, hah...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants