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
{{ message }}
Repository navigation
Debug protocol extension: support for 'type' in expression evaluation result #32
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'
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?
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.
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.
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.
Gregg Miskelly (@gregg-miskelly)InitializeRequestArguments got an optional supportsVariableType (available in the July release or next insiders; debug protocol 1.11).
Activity
weinand commentedon Jun 14, 2016
Gregg Miskelly (@gregg-miskelly) how should a type be used in the UI?
gregg-miskelly commentedon Jun 14, 2016
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:

weinand commentedon Jun 15, 2016
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?
gregg-miskelly commentedon Jun 15, 2016
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 --
weinand commentedon Jun 21, 2016
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)
weinand commentedon Jun 23, 2016
I've added a 'type' attribute to the
Variabletype and we are planning to use this in a hover (microsoft/vscode#8040).weinand commentedon Jun 23, 2016
/cc David Karlaš (@DavidKarlas)
hackwaly commentedon Jul 8, 2016
Seems not enough?
I see:
There is no way to response the type information of the variable of the evaluate result self.
As the comment says:
variablesReferenceis used for VariablesRequest.weinand commentedon Jul 8, 2016
Gregg Miskelly (@gregg-miskelly)
InitializeRequestArgumentsgot an optionalsupportsVariableType(available in the July release or next insiders; debug protocol 1.11).weinand commentedon Jul 8, 2016
文宇祥 (@hackwaly) good point. I'll add
typeto the response.