ForEach visualization should show null values as 'null' and empty string as "" in the collapsed entry

James Manning 8 years ago updated by Omer Raviv 8 years ago 1
sshot @ http://i.imgur.com/xiotN.png

Currently in the 'collapsed' string version of the object, null and empty string both show up the same (don't really show up at all), so you can't tell which is which without expanding.

Having null be represented as 'null' (perhaps in italics font or whatever) would allow the user to differentiate.

Secondary but less important would be to have empty string show up as "" in the collapsed entry, but since other strings don't have surrounding quotes in the collapsed entry, I could see that as less desirable (although IMHO having the quotes in the collapsed entry is better since it helps make it explicit that it's a string)

This issue is actually not specific to the Foreach Visualization or even to BugAid, but rather, it's just the way Visual Studio shows Dictionaries in general. As you can see, it looks the same in the Watch window (regardless of whether BugAid is installed) :

The problem is actually in the way System.Collections.Generic.KeyValuePair.ToString() was implemented.

Luckily, you can work around this issue with BugAid by simply starring the "Key" and "Value" properties:

Once you do that, the problem will be fixed for good in the Foreach Visualization, the Datatip, and the QuickWatch window. 

In any case, thanks for pointing this out - we'll consider making these two properties starred by default when you install BugAid.