Tuesday, April 14, 2020

View constants where you use them in your C# code

When debugging or just trying to understand code, it can be useful to see the value of constants. Yes, you can try and remember the values but seeing them is often easier.

The above is enabled by a new extension, I've just published, called Const Visualizer.

Yes, there's a lot of similarity between this and String Resource Visualizer.

Const Visualizer is something I've been meaning to create for a while but I've done it now as a pre-cursor to adding new functionality in the String Resource Visualizer. It's forced me to learn how to integrate Roslyn code analysis into an extension and look at other ways of analyzing the contents of a solution.

Why not put all the functionality related to const values and string resources in one extension?
Two reasons. 1. Because I prefer lots of simple tools that each focus on a single task. These can then be combined and used as preferred.  and 2. Because the existing "String Resource Visualizer" name doesn't expand well to cover other functionality too.

Please install it, give it a try, and see what you think. Does it make your coding-life easier too?