Skip to content

show variable type on hover #8040

Closed
Closed

Description

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.

Activity

  1. added
    feature-request
    debug
    on Jun 23, 2016
  2. TitaneBoy commented on Apr 24, 2017

    @TitaneBoy

    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...

  3. weinand commented on Apr 24, 2017

    @weinand
    ContributorAuthor

    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:

    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).

  4. TitaneBoy commented on Apr 24, 2017

    @TitaneBoy

    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

    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

  5. TitaneBoy commented on Apr 24, 2017

    @TitaneBoy

    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"

  6. weinand commented on Apr 24, 2017

    @weinand
    ContributorAuthor

    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

  7. TitaneBoy commented on Apr 24, 2017

    @TitaneBoy

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

  8. locked and limited conversation to collaborators on Nov 18, 2017
  9. added a commit that references this issue on Sep 6, 2026
    445fbd2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

debugfeature-requestverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions