mike-ward / VSColorOutput

Color highlighting to Visual Studio's Build and Debug Output Windows
MIT License
430 stars 93 forks source link

Invalid coloring in some specific cases #109

Open bramborman opened 4 years ago

bramborman commented 4 years ago

I'm getting some wrongly-colored lines in my output on lines such as this:

15>Foo.cs(226,17,226,89): warning CA1806: Bar calls TryParse but does not explicitly check whether the conversion succeeded....

It's a warning message but probably because it contains the string succeeded it gets colored to the green success-color instead of warning yellow color.

I think warning should have precedence over success maybe every time or it should be checked by what appears earlier in the string?

mike-ward commented 4 years ago

Probably need a separate rule that checks for a specific warning pattern. Something that matches warning ??number: perhaps.

bramborman commented 4 years ago

Well it works perfectly for other lines with the same pattern that do not contain the word succeeded so I guess the problem is that the string contains both warning and succeeded and the success color takes precedence. IMHO it should be that warnings have precedence.

Here is probably more obvious example:

repro

mike-ward commented 4 years ago

You do know you can edit the regex's for pattern matching, right? Maybe you could try altering the regex's to get the desired result (IMHO)...

bramborman commented 4 years ago

Yeah, I know and I can confirm that just by reordering the original patterns this issue can be fixed. I reported it because I think it should be so by default so people like me who filter the output by color when quickly looking at it are not misled. But that's just my opinion...

mike-ward commented 4 years ago

Agreed. Just needed to know if that fixed your issue. So I assume just bumping it up one level fixed it. I'll add this to a new release soon.

bramborman commented 4 years ago

Actually had to do something more as the warning regex that needed to be moved up was the maybe second or third lowest. I don't really remember and there's no Reset to default button but maybe all the warning regexes should be higher than the success ones?