microsoft / vscode-debugadapter-node

Debug adapter protocol and implementation for VS Code.
Other
273 stars 79 forks source link

Debug protocol needs 'full name' to properly support 'Add to watch' #73

Closed gregg-miskelly closed 8 years ago

gregg-miskelly commented 8 years ago

Description of the problem.

VS Code currently implements the 'Add to Watch' feature by taking the name property of the Variable and trying to combine them together. But this is not necessarily the correct name to evaluate. This is wrong for C# for root items due to our type annotations, and it can be wrong for child items any time that '.' isn't the right way to combine elements together.

Suggested fix

Variable should have a new optional property for the evaluatable name. If that property is provided, Add to Watch should use this value instead. In VS, we call this value the 'full name'. For example, if p is a local pointer in C++, and m_example is a field, the full name for this would be p->m_example.

Steps to Reproduce:

  1. Install .NET Core, VS Code, and the C# extension (see http://aka.ms/vscclrdebugger for instruction)
  2. Create hello world with dotnet new
  3. Debug hello world and stop at the first line
  4. Look at the locals window
  5. Right click on args and invoke 'Add to Watch'

Result: VS Code will add the name of the local (args [string[]]) which doesn't evaluate since we needed to add our type annotation.

weinand commented 8 years ago

@gregg-miskelly I propose to name this new attribute evaluateName.

gregg-miskelly commented 8 years ago

@weinand sounds good to me