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

Add support for rendering "uncovered" lines as red. #37

Closed
Raynos opened this issue Mar 28, 2017 · 7 comments
Closed

Add support for rendering "uncovered" lines as red. #37

Raynos opened this issue Mar 28, 2017 · 7 comments

Comments

@Raynos
Copy link

Raynos commented Mar 28, 2017

I'm currently integrating go coverage with lcov and this extension and it's pretty dope.

image

Go coverage is slightly different to other coverage systems and only marks "start statements" as covered instead of the "entire statement"

My code coverage (istanbul) UI renders this as a HTML page

image

Notice how there are some lines that have no hits, like method signatures ( but also, not in screenshot, interface and struct declrations also have 'no coverage' because they are declerations.

It would be really nice if detail.hit === 0 ( aka this statement is not covered ) that we somehow mark that line as "red" or some other color theme in vs code.

This would mean having two renderLines array, one for "covered" and one for "uncovered" and then setting decorations for both types of coverage information.

I find that scanning through a file for "red lines" is a lot easier then scanning through a file for "not highlighted" lines because a lot of the "not highlighted" lines look like this :

image

Everything in that screenshot is actually covered but it takes some visual processing to double check that.

@MeirionHughes
Copy link

Some lines / code-branches can be partially covered too.

@ryanluker
Copy link
Owner

ryanluker commented Mar 28, 2017

Thanks for the feedback! Oddly enough I am working on enhanced coverage currently (adding partial coverage support at the moment #36 ). I don't see a reason why I couldn't add another indicator for the lack of coverage you outlined above @Raynos 😄 . I will link some further details here once I get a working version sussed out.

@Raynos
Copy link
Author

Raynos commented Mar 28, 2017

Partially covered means a single line statement contains multiple branches ( aka 1 line ternary ) and only some of the branches are covered ?

That sounds quite a bit harder then lack of coverage :)

@ryanluker
Copy link
Owner

ryanluker commented Mar 29, 2017

Yah you are correct about how "partial" coverage will look, and that it is more difficult then just adding lack of coverage based on the hit === 0. The PR I mentioned before has a few critical pieces that allow multiple coverage types to work nicely together, if partial proves to be taking a while I can always split it off and add the uncovered coverage first instead.

@ryanluker
Copy link
Owner

ryanluker commented Mar 29, 2017

Need to cover some edge cases and create unit tests but I think I have a workable first version:
new-coverage-styles

@Raynos
Copy link
Author

Raynos commented Mar 29, 2017

Sweet, that's great, thanks @ryanluker

@ryanluker
Copy link
Owner

@Raynos just released 0.3.0 to the marketplace, let me know what you think of the uncovered lines 😄 . Going to close this issue in the meantime.

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

3 participants