提交 3f0ab988 编写于 作者: I isidor

debug: show variable type on hover of name

fixes #8040
上级 0edf9421
......@@ -71,6 +71,7 @@ export function renderExpressionValue(expressionOrValue: debug.IExpression | str
export function renderVariable(tree: tree.ITree, variable: model.Variable, data: IVariableTemplateData, showChanged: boolean): void {
if (variable.available) {
data.name.textContent = variable.name + ':';
data.name.title = variable.type ? variable.type : '';
}
if (variable.value) {
......
......@@ -27,9 +27,9 @@ function resolveChildren(debugService: debug.IDebugService, parent: debug.IExpre
return session.variables({ variablesReference: parent.reference }).then(response => {
return arrays.distinct(response.body.variables.filter(v => !!v), v => v.name).map(
v => new Variable(parent, v.variablesReference, v.name, v.value)
v => new Variable(parent, v.variablesReference, v.name, v.value, v.type)
);
}, (e: Error) => [new Variable(parent, 0, null, e.message, false)]);
}, (e: Error) => [new Variable(parent, 0, null, e.message, null, false)]);
}
function massageValue(value: string): string {
......@@ -282,7 +282,7 @@ export class Variable extends ExpressionContainer implements debug.IExpression {
// Used to show the error message coming from the adapter when setting the value #7807
public errorMessage: string;
constructor(public parent: debug.IExpressionContainer, reference: number, public name: string, value: string, public available = true) {
constructor(public parent: debug.IExpressionContainer, reference: number, public name: string, value: string, public type: string = null, public available = true) {
super(reference, `variable:${ parent.getId() }:${ name }`, true);
this.value = massageValue(value);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册