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

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

Closed
gregg-miskelly opened this issue Jun 13, 2016 · 10 comments
Assignees
Milestone

Comments

@gregg-miskelly
Copy link
Member

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'
@weinand weinand added the feature-request Request for new features or functionality label Jun 14, 2016
@weinand weinand self-assigned this Jun 14, 2016
@weinand
Copy link
Contributor

weinand commented Jun 14, 2016

@gregg-miskelly how should a type be used in the UI?

@gregg-miskelly
Copy link
Member Author

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

@weinand
Copy link
Contributor

weinand commented Jun 15, 2016

@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?

@gregg-miskelly
Copy link
Member Author

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

@weinand weinand added protocol change and removed feature-request Request for new features or functionality labels Jun 16, 2016
@weinand
Copy link
Contributor

weinand commented Jun 21, 2016

@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 @isidorn

@weinand
Copy link
Contributor

weinand commented Jun 23, 2016

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

@weinand weinand closed this as completed Jun 23, 2016
@weinand
Copy link
Contributor

weinand commented Jun 23, 2016

/cc @DavidKarlas

@hackwaly
Copy link

hackwaly commented Jul 8, 2016

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.

@weinand
Copy link
Contributor

weinand commented Jul 8, 2016

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

@weinand
Copy link
Contributor

weinand commented Jul 8, 2016

@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
Projects
None yet
Development

No branches or pull requests

3 participants