FortuneN / FineCodeCoverage

Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
https://marketplace.visualstudio.com/items?itemName=FortuneNgwenya.FineCodeCoverage
Other
522 stars 40 forks source link

Colour settings not reflected in the left hand margin, nor the coverage report #307

Closed JoshSnek closed 6 months ago

JoshSnek commented 1 year ago

Installed product versions

Description

I changed the colour settings (fonts and colour settings). it was reflected in the scroll bar section of the covered file, but not in the coverage report, nor the left hand margin

Steps to recreate

  1. set "CoverageColoursFromFontsAndColours" to true
  2. in Fonts and Colours, set "FCC Covered" to "Lime"
  3. generate a coverage report
  4. notice that the colours in the report and the left hand margin have not changed to lime

Current behavior

colour no change

Expected behavior

colour should change pls

Side Notes

tonyhallett commented 1 year ago
  1. in Fonts and Colours, set "FCC Covered" to "Lime"

FCC does not add any entries to Fonts and Colors, so I do not know what you are referring to here.

The setting CoverageColoursFromFontsAndColours will take values from Coverage Touched Area Coverage Not Touched Area Coverage Partially Touched Area

Specifically the Item Background https://github.com/FortuneN/FineCodeCoverage/blob/63024da85a092e587fa53efe269333fca6d354b0/SharedProject/Impl/CoverageColour/Provider/CoverageColorProvider.cs#L101

These values are only used for the two margins that are available.

image

this is dependent upon the specific fonts and colors provider being available in visual studio. The category that FCC tries to get colours for is ff349800-ea43-46c1-8c98-878e78f46501

Unfortunately fonts and colors with my community version of VS 2022 is not showing these options, so I cannot test the code works as expected. When I added the feature I was able to set these values in fonts and colors and the behaviour was as expected. Perhaps you need to re-run coverage to see the changes. I cannot remember if the ui updates automatically.

With regards to the report are you expecting the percentage bars to change ? image

The report is generated by report generator with some adjustments made to account for the vs color theme. The green and red have not been adjusted.

I am working on a new report generator that also takes colours from the vs color theme. I am currently using EnvironmentColors.VizSurfaceGreenMedium for the green, I am not showing the red. This looks fine with all the themes that I have installed. I can use "Coverage Touched Area" but if I am going down that route then there should be a setting specifically for the report.

JoshSnek commented 1 year ago

maybe i'm using a different version to you, but:

FCC does not add any entries to Fonts and Colors, so I do not know what you are referring to here. setting in Fine Code Coverage: image setting in Environment: image lack of setting called "Coverage Touched Area" image

see how the right hand margin reflects my change of colour (using lime) but none of the other greens do

image image image

i assumed this was a bug but perhaps it's a feature request?

tonyhallett commented 1 year ago

Apologies. I wasn't aware that this had been surfaced.

image

This does allow setting the marks in the overview margin but the change is not handled to feed back to the glyph margin.

This could be used instead of the "Coverage Touched Area" etc Text Marker Items that are absent. I assume that these options are only guaranteed to be there in Vs Enterprise. They were there when I was debugging the extension in Vs Community when I added the feature. I even opened a visual studio issue on it that was not resolved.

I will decide upon an appropriate solution and will include in the next release.

ooples commented 9 months ago

Any update on this?

tonyhallett commented 6 months ago

Done - see readme for video / options