ExpressionTreeVisualizer
ExpressionTreeVisualizer copied to clipboard
Watch expression on value opened in new window
When opening the value of an expression node in a new window, the WatchExpressionFormatString for the root ExpressionNodeData needs to be updated to the parent root.
We can either recreate the watch expression in the ResolvePath function, or we can pass it along when setting the Path.
Two functions:
- generate cast + access from a single path component
- generate cast and access from a full path
Part of the second function would be to handle values:
- if the object is a
ConstantExpressionthen use the Value property and cast to the narrowest public type of the object at the Value property - if the object is a closed-over variable
MemberAccessExpressionthen copy the logic fromExtractValue-- wrap in a call toLambda,CompileandInvoke
If the debugged expression has been set in the source window, pass it along with the options.