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

Show variable type on hover #26

Closed
db4 opened this issue Jul 8, 2016 · 13 comments
Closed

Show variable type on hover #26

db4 opened this issue Jul 8, 2016 · 13 comments

Comments

@db4
Copy link
Contributor

db4 commented Jul 8, 2016

From VS Code 1.3.0 release notes:

Show variable type on hover: If a debug adapter returns the optional type attribute for the variable type, VS Code will show the value of this attribute when hovering over the variable's name.

Can we support this?

@hackwaly
Copy link
Owner

hackwaly commented Jul 8, 2016

Sure! I'm downloading new version of VS Code now.

@hackwaly
Copy link
Owner

hackwaly commented Jul 8, 2016

I can't get it work, even I set type? property. Seems variableRequest can't directly response a variable with type, but can response a variable with sub-variables that has type. Maybe it's a bug of new version of DebugProtocol. https://github.com/Microsoft/vscode-debugadapter-node/blob/master/protocol/src/debugProtocol.ts#L575

Are there any screenshots about showing variable type? Or there is an extension implemented this feature? microsoft/vscode-debugadapter-node#32

@hackwaly
Copy link
Owner

hackwaly commented Aug 9, 2016

I consider close this issue because of ocamldebug only gives us the type of result variable self per display command, which is useless. Otherwise we need issue lots of display commands to retrieve type informations of result's children (or call member or property).

I implemented the simpler one in 046ee31, and it will release in v0.5.0.

@hackwaly hackwaly closed this as completed Aug 9, 2016
@hackwaly hackwaly added this to the 0.5.0 milestone Aug 9, 2016
@db4
Copy link
Contributor Author

db4 commented Aug 9, 2016

I consider close this issue because of ocamldebug only gives us the type of result variable self per display command, which is useless.

When you issue print command it responds with
<variable name> : <type> = <value>
You are parsing this anyway and can use <type> info as well.

@hackwaly
Copy link
Owner

hackwaly commented Aug 9, 2016

Yes, I did it in v0.5.0 which is released.

@db4
Copy link
Contributor Author

db4 commented Aug 9, 2016

Yes, I did it in v0.5.0 which is released.

Hmm, I still don't see types in the debugger. E.g. for a record type a see <record> instead of the real type name. Maybe I should adjust some setting?

@hackwaly
Copy link
Owner

hackwaly commented Aug 9, 2016

It's hidden by default in vscode.

Said https://code.visualstudio.com/updates/June_2016

Show Variable Type on Hover
If a debug extension supports variable types, we now show the type when hovering over the variable name.

image

@hackwaly
Copy link
Owner

hackwaly commented Aug 9, 2016

Eh... found a bug: it shows array as list.

@hackwaly
Copy link
Owner

hackwaly commented Aug 9, 2016

Maybe showing type instead of <record> being there is better.

@hackwaly hackwaly reopened this Aug 9, 2016
@db4
Copy link
Contributor Author

db4 commented Aug 9, 2016

Ah, I see. Yes, it works when hovering over a variable in the watch window. But I expected it to work in an editor window also:

image

hackwaly added a commit that referenced this issue Aug 9, 2016
@db4
Copy link
Contributor Author

db4 commented Aug 9, 2016

This commit cb8d50b breaks hovering over plain variables: instead of the variable's value its type is shown now.

@hackwaly
Copy link
Owner

hackwaly commented Aug 9, 2016

Sorry, my mistake. Fixed in 365f23c.

@db4
Copy link
Contributor Author

db4 commented Aug 9, 2016

Now it's OK. Thanks!

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

No branches or pull requests

2 participants