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 #8040

Closed
weinand opened this issue Jun 23, 2016 · 6 comments
Closed

show variable type on hover #8040

weinand opened this issue Jun 23, 2016 · 6 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality verified Verification succeeded
Milestone

Comments

@weinand
Copy link
Contributor

weinand commented Jun 23, 2016

This feature request asks for adding the UI for this debug protocol extension: microsoft/vscode-debugadapter-node#32

If the optional 'type' attribute is available for a variable, the type should be shown when hovering over the name part of a variable.

@TitaneBoy
Copy link

TitaneBoy commented Apr 24, 2017

Hi everyone. Hi @weinand. I was wondering if there would be a way to have this functionnality (i.e Having the type definition on mouse over ) but not in debug. For example, I am writting a function which has parameters with some types. But when I want to see the type definition (which comes from other files) of a variable (like parameters), I can't see it.. I just see the type name, not its definition.

Thank you for your answer...

@weinand
Copy link
Contributor Author

weinand commented Apr 24, 2017

@TitaneBoy VS Code already supports what you are asking for. In the following screenshot I am hovering over the logger.setup method and the hover shows the method parameters:

2017-04-24_17-25-06

But this informations is only available if you are using a language extension that supports this (in my example it is coming from VS Code's built-in TypeScript extension).

@TitaneBoy
Copy link

TitaneBoy commented Apr 24, 2017

@weinand: Well...I know that we can have the function definition with mouse over...I think I didn't ask the right question..

Suppose I have these instructions:

First_File.ts

export interface ITypeInterface {
   firstVariable: string;
   secondVariable: number;
   thirdVariable: {id: number; description: string};
}

Second_File.ts
let myVariable: ITypeInterface = undefined;

If I want to see the definition of "ITypeInterface " with the mouse over on the "ITypeInterface" name, how can I do ? If the ITypeInterface is defined somewhere else in another file, I had to "Crl + Click" on the type name to get its definition. But by doing that, I will switch my file view and my context at the same time. Is there a way to see the type definition (and not only the name) by mousing over the type name ?

Thank you

@TitaneBoy
Copy link

Just to be sure: I'm using typescript language in my context and let's assume that import of the First_file.ts is done correctly in the "Second_File.ts"

@weinand
Copy link
Contributor Author

weinand commented Apr 24, 2017

Showing the full type definition on hover doesn't make a lot of sense because the hover size is fairly limited. You would only be able to see the first couple of lines in the hover.

But try to use the "Peek Definition" action (alt-F12) instead: it shows the full type definition without switching files:

2017-04-24_17-53-00

@TitaneBoy
Copy link

@weinand : Perfect...This is what I was looking for...Thank you again for your fast answer and your great support...:-)

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants