microsoft / ConcordExtensibilitySamples

Visual Studio Debug Engine Extensibility Samples
Other
121 stars 50 forks source link

"IEnumerable Visualizer" support for our language #104

Closed RobertvanderHulst closed 8 months ago

RobertvanderHulst commented 10 months ago

The VS debugger now has the "IEnumerable Visualizer". We have our own debugger support, including our custom Debugger Expression Evaluator (derived from Roslyn). When debugging and opening the visualizer for a value we get the error message "Could not load this Custom Viewer" When I use the visualizer on a variable of the same type in C# the visualizer works. Does anybody know what we need to do to enable this?

gregg-miskelly commented 9 months ago

What do get from the troubleshooting logs when you try to open the visualizer?

RobertvanderHulst commented 9 months ago

@gregg-miskelly I was not aware of these troubleshooting logs. I'll try this and report back what I find. Thanks for the tip!

sae42 commented 9 months ago

@RobertvanderHulst After seeing this issue I noticed this visualizer also didn't work for our EE. It seems you should be able to get it working by adding an extra registry entry for your EE (it worked for me at least): "ClrCustomVisualizerVSHost"="{E82F32A8-074E-465A-86E5-D68A87284F61}"

I couldn't find much documentation on this entry but searching for ClrCustomVisualizerVSHost turned up this similar issue #26

RobertvanderHulst commented 9 months ago

@sae42 Simon THANK YOU. You're the best! This works indeed. For those of you that are reading along:

[$RootKey$\AD7Metrics\ExpressionEvaluator\{GuidLanguage}\{GuidVendor}]
"ClrCustomVisualizerVSHost"="{E82F32A8-074E-465A-86E5-D68A87284F61}"

It would be really nice if all these registry settings could be documented somewhere! I found a lot of settings in for example VCSharp_EE_Registry.pkgdef, but we could really use some documentation about this.

RobertvanderHulst commented 9 months ago

Now that this is working, I have an additional question: Why is the IENumerable viewer showing columns for properties and fields that are marked with [DebuggerBrowsable(DebuggerBrowsableState.Never)]. That really does not make sense, and makes the display really ugly. Or do I need to implement a DebuggerTypeProxy for these types?

gregg-miskelly commented 8 months ago

I put out a PR to fix these in the Iris sample: https://github.com/microsoft/ConcordExtensibilitySamples/pull/109