ryanluker / vscode-coverage-gutters

Display test coverage generated by lcov and xml - works with many languages
https://marketplace.visualstudio.com/items?itemName=ryanluker.vscode-coverage-gutters
MIT License
460 stars 88 forks source link

Display information about partial branch coverage #391

Open moi90 opened 1 year ago

moi90 commented 1 year ago

Is your feature request related to a problem? Please describe. Some lines are yellow (partial), but I don't know which branch was taken and which one still needs testing.

Describe the solution you'd like I would like to have a tooltip that displays additional coverage information.

Describe alternatives you've considered Currently, this only is available with other tools.

ryanluker commented 1 year ago

Thanks for the ticket @moi90!

Do you have an example from another tool you can share?

Currently, the highlighting is the whole line or none of the line, but I wonder if it could be more "partial" as well. Meaning, if the line has a partial branch (like you alluded to) the coverage highlight would only go as far as the code had traversed.

partial-coverage-lines

Definitely something to investigate or an option as well (it might be easier to implement than other popover gui elements as I am not familiar with that area of the vscode extension api).

moi90 commented 1 year ago

pytest-coverage's html output displays some additional information:

grafik

The corresponding xml is:

<line number="40" hits="1" branch="true" condition-coverage="50% (1/2)" missing-branches="41"/>

I find the "40 ↛ 41" especially useful. Seeing the condition-coverage would be useful as well.

But I would understand if these (mostly cosmetical) improvements do not justify the effort.

ryanluker commented 1 year ago

@moi90 Thanks for the example, it definitely looks doable and there is other work that is similar to this (adding ui elements similar to codelens) that could be done in parallel with this.

moi90 commented 1 year ago

Cool, I'm looking forward to it! (But take your time, this extension is already a great help as it is.)