提交 4dd7876b 编写于 作者: I isidor

debug: show simple hover when complex objects has no children

fixes #2216
上级 af4f2c55
...@@ -32,7 +32,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget { ...@@ -32,7 +32,7 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
private domNode: HTMLElement; private domNode: HTMLElement;
private isVisible: boolean; private isVisible: boolean;
private tree: ITree; private tree: ITree;
private showAtPosition: editorcommon.IPosition; private showAtPosition: editorcommon.IEditorPosition;
private lastHoveringOver: string; private lastHoveringOver: string;
private highlightDecorations: string[]; private highlightDecorations: string[];
private treeContainer: HTMLElement; private treeContainer: HTMLElement;
...@@ -140,8 +140,8 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget { ...@@ -140,8 +140,8 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
this.doShow(pos, variables[0]); this.doShow(pos, variables[0]);
} }
private doShow(position: editorcommon.IEditorPosition, expression: debug.IExpression): void { private doShow(position: editorcommon.IEditorPosition, expression: debug.IExpression, forceValueHover = false): void {
if (expression.reference > 0) { if (expression.reference > 0 && !forceValueHover) {
this.valueContainer.hidden = true; this.valueContainer.hidden = true;
this.treeContainer.hidden = false; this.treeContainer.hidden = false;
this.tree.setInput(expression).then(() => { this.tree.setInput(expression).then(() => {
...@@ -164,11 +164,16 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget { ...@@ -164,11 +164,16 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
while (navigator.next()) { while (navigator.next()) {
visibleElementsCount++; visibleElementsCount++;
} }
const height = Math.min(visibleElementsCount, MAX_ELEMENTS_SHOWN) * 18;
if (this.treeContainer.clientHeight !== height) { if (visibleElementsCount === 0) {
this.treeContainer.style.height = `${ height }px`; this.doShow(this.showAtPosition, this.tree.getInput(), true);
this.tree.layout(); } else {
const height = Math.min(visibleElementsCount, MAX_ELEMENTS_SHOWN) * 18;
if (this.treeContainer.clientHeight !== height) {
this.treeContainer.style.height = `${ height }px`;
this.tree.layout();
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册