You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi everyone. Hi Andre Weinand (@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.
Philippe D'Alva (@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:
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).
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 ?
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"
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:
Activity
TitaneBoy commentedon Apr 24, 2017
Hi everyone. Hi Andre Weinand (@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 commentedon Apr 24, 2017
Philippe D'Alva (@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:
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 commentedon Apr 24, 2017
Andre Weinand (@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
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 commentedon Apr 24, 2017
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 commentedon 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:
TitaneBoy commentedon Apr 24, 2017
Andre Weinand (@weinand) : Perfect...This is what I was looking for...Thank you again for your fast answer and your great support...:-)
debug: show variable type on hover of name