microsoft / microsoft/ConcordExtensibilitySamples

Calling back into the default expression evaluator doesn't work with arrays

Open
#75 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
135
Forks
54
Avg merge
5h 58m
Merged PRs (30d)
3

Description

This may be an issue with my implementation, but I've noticed that when I try to create a visualizer that just kicks the work back to the default expression evaluator I get different results than when I have no visualizer at all. In particular, I start to see ??? in the display string for array elements in the Watch window.

In this screenshot the NoVis type has no custom visualizer at all. Notice that it shows the value of the single array element in the display string. The DefaultVis type has a custom visualizer but all it does is callback into EvaluateExpressionCallback from EvaluateVisualizedExpression and set pUseDefaultEvaluationBehavior to true in UseDefaultEvaluationBehavior.

I'm using VS2022 (17.0.4) here.
image

In VS2019 (16.11.8) I get slightly different results. I can run the same solution (after downgrading the Microsoft.VSSDK.BuildTools package and build tools version) and it works correctly. However, it will exhibit the same issue if I set pUseDefaultEvaluationBehavior to false and then use the callbacks to do default visualization in the rest of the IDkmCustomVisualizer functions.
image

vs-native-debug-visualizer-github.zip

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached vs-native-debug-visualizer-github.zip sample and trace EvaluateVisualizedExpression, EvaluateExpressionCallback, and UseDefaultEvaluationBehavior. Compare the callback behavior in VS2022 17.0.4 with VS2019 16.11.8, focusing on array elements in the Watch window. Done means delegating to default evaluation no longer displays ??? for array elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.