A long time ago I used Visual Studio and I remember that the watch window during debugging was much smarter in showing collections than in Visual Studio Code (which I am using now). For example, when I make a simple List
of Strings
and I inspect this in the watch window in VSCode I get the following
Whereas in Visual Studio the quick watch feature was much more useful:
In general, I am mostly interested in the values in the collection, which I have to dig down fourlevels of hierarchy in vscode and is quite obfuscated. Does anyone know of an extension or a way to get a more usable watch window for collections?
This won't universally reformat the debug watch window for list, but it may help you. You can add attributes to your classes which will modify the display of a classes member for instance DebuggerDisplay
[DebuggerDisplay("Count = {count}")]
class MyHashtable
{
public int count = 4;
}
This maybe useful, Another one that will come in handy is the DebuggerBrowsable this will automatically hide the root and display it's children
[DebuggerBrowsable(DebuggerBrowsableState.RootHidden)]
These attributes will help control debugging on custom classes
There is currently no extension which could reformat the debug watch view content.
OmniSharp/omnisharp-vscode
plugin has no issue directly related to this.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With