Skip to content

Debug protocol extension: support for 'type' in expression evaluation result #32

Closed

Description

To be able to use the debug protocol in other IDEs (Visual Studio, Xamarin Studio) we should think about how the debug protocol should support expression evaluation windows that have a 'Type' column.

Suggestion:

  • 'Variable' interface gets a new 'type?: string' member
  • InitializeRequestArguments adds a new 'showsVariableTypes?: boolean'

Activity

  1. added
    feature-request
    on Jun 14, 2016
  2. weinand commented on Jun 14, 2016

    @weinand
    Contributor

    Gregg Miskelly (@gregg-miskelly) how should a type be used in the UI?

  3. gregg-miskelly commented on Jun 14, 2016

    @gregg-miskelly
    MemberAuthor

    In VS Code UI: I would imagine that it wouldn't unless VS Code decides it wants to improve the experience for languages that have rich typing.

    In other debuggers that have a type column's already: something like this:
    vs watch window

  4. weinand commented on Jun 15, 2016

    @weinand
    Contributor

    Gregg Miskelly (@gregg-miskelly) the VS Code approach to types was to combine types with the variable name (and not the value) because that aligns nicely with the way how types are used in the syntax of programming languages. However, fully qualified types seem to be really unwieldy for nice and lean UIs. Could we use some form of progressive disclosure to make type information available? E.g. having a 'type' hover?

  5. gregg-miskelly commented on Jun 15, 2016

    @gregg-miskelly
    MemberAuthor

    Andre Weinand (@weinand) yes, having some sort of a type hover sounds very useful. Are you thinking we would have some sort of short type name in the name or value that could be hovered to reveal the long name?

    For some historical background: In the C# extension, we started with the type in the name, but we found it didn't work all that well. It was pretty early on that we switched it, so I don't remember precisely why, but I think it was because --

    • For long types, it got in the way with it at the beginning.
    • For .NET the default value for objects already indicates the type. So we found we could omit the type in these cases, and that looked better if it was at the end.
    • At least at the time, I think VS Code wouldn't display the type in the watch window for the top level item.
  6. added and removed
    feature-request
    on Jun 16, 2016
  7. weinand commented on Jun 21, 2016

    @weinand
    Contributor

    Gregg Miskelly (@gregg-miskelly) our plan is to show an optional type when hovering over the name of a variable.
    So a debug-adapter is free to either add a short type to the name of a variable and reveal the full type on hover, or only show the type on hover.

    /cc Isidor Nikolic (@isidorn)

  8. weinand commented on Jun 23, 2016

    @weinand
    Contributor

    I've added a 'type' attribute to the Variable type and we are planning to use this in a hover (microsoft/vscode#8040).

  9. weinand commented on Jun 23, 2016

    @weinand
    Contributor
  10. hackwaly commented on Jul 8, 2016

    @hackwaly

    I've added a 'type' attribute to the Variable type

    Seems not enough?

    I see:

        export interface EvaluateResponse extends Response {
            body: {
                /** The result of the evaluate. */
                result: string;
                /** If variablesReference is > 0, the evaluate result is structured and its children can be retrieved by passing variablesReference to the VariablesRequest */
                variablesReference: number;
            };
        }
    

    There is no way to response the type information of the variable of the evaluate result self.
    As the comment says: variablesReference is used for VariablesRequest.

  11. weinand commented on Jul 8, 2016

    @weinand
    Contributor

    Gregg Miskelly (@gregg-miskelly) InitializeRequestArguments got an optional supportsVariableType (available in the July release or next insiders; debug protocol 1.11).

  12. weinand commented on Jul 8, 2016

    @weinand
    Contributor

    文宇祥 (@hackwaly) good point. I'll add type to the response.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions