Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't view locals in the watch window (or by hovering the mouse over them) #15

Closed
RobD6 opened this issue Sep 7, 2016 · 4 comments
Closed

Comments

@RobD6
Copy link

RobD6 commented Sep 7, 2016

Using version 1.0.3 with Unity 5.4.0f3, the watch window can't view member variables without "this" specified explicitly (see screenshot attached).
image

Stepping through in the debugger, it's hitting the case in UnityDebugSession.cs line 478 where the "Unknown" flag is set. Unfortunately I'm on a deadline so can't investigate further right now (my knowledge of the Mono runtime isn't good, so it'd probably take me a while!).

Rob.

@lukaszunity
Copy link
Contributor

The issue is that we do not do any analysis of the C# source code and the debugger protocol does not provide it either. So the watch requests are are just passed directly to the Mono debugger and in this case there is no local variable named LoadRequest and you need to full type this.LoadRequest.

What you can do is right click on locals and select Add Watch and that should work.

I will close this issue and I will add it as a feature for our backlog.

@CoenraadS
Copy link

CoenraadS commented Nov 16, 2016

Is there any ETA on this feature? It would be very useful. I suspect when Unity gets out of beta and more people start using VSCode this issue may get more popular.

@lukaszunity
Copy link
Contributor

It is unlikely that we will support hovering over variables, based upon how the current debugger protocol works. I've looked into this feature and the debugger protocol just passes strings and substrings of the text you are hovering over to the debugger extension. This means you need to parse the string you get and guess whether the value is type, local, global, class member, etc.

For an statement like this

if(value != 32 && typeof(someType) != MyManager)

If you hover over someType then protocol might pass the string if(value != 32 && typeof(someType to the debugger. Parsing this string correctly in the debugger extension and always providing the correct results is very hard.

If the debugger protocol some day will work together with the C# parsing and just provide the exact expression that need to be evaluated, which would be the ideal solution, then we could very easily support this feature.

@toxikman
Copy link

toxikman commented Dec 13, 2016

Perhaps you could evaluate the expression and if it's a symbol (variable or method name) and it's not able to be evaluated then you append "this." to the string and evaluate it again? Maybe you're saying you have no direct control over the evaluation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants