p10tyr / PrestoCoverage

Visual Studio Extension for simple coverage visuals
Apache License 2.0
45 stars 6 forks source link

When changing source code coverage is incorrect #6

Closed p10tyr closed 5 years ago

p10tyr commented 5 years ago

After running tests and coverlet the margin glyphs are updated

When you start to add or remove lines then the glyphs are no longer valid since they are binding to the Line numbers in the coverage but we have now updated the source

Initial thoughts to solve the problem

Problem with removing them is then it looks like the tests/coverage have not run. May be confusing. The nice thing about changing the colour, probably Amber would show tests ran.. but now out of date. So rerunning it (maybe later from withing VS) would change everyback to red/green.

p10tyr commented 5 years ago

So it turned out to be easier than I thought.

There is an API available with document version and I can test if it has changed.

The quite nice thing about this is.. if you adding new code in .. the glyphs automatically move with the original line of code.. without me having to do any thing.. So that kind of worked out well. When removing the line the glyph goes away and undoing wont bring it back.. that is OK for now.

When adding new lines I just do not add any glyphs.. it just continues

version 1.11+ now has this feature