提交 5b45df48 编写于 作者: I isidor

debug: do not highlight hovered and fix hectic hover jumps

fixes #2302
上级 7beba86b
...@@ -35,7 +35,6 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget { ...@@ -35,7 +35,6 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
private isVisible: boolean; private isVisible: boolean;
private tree: ITree; private tree: ITree;
private showAtPosition: editorcommon.IEditorPosition; private showAtPosition: editorcommon.IEditorPosition;
private highlightDecorations: string[];
private treeContainer: HTMLElement; private treeContainer: HTMLElement;
private valueContainer: HTMLElement; private valueContainer: HTMLElement;
...@@ -58,7 +57,6 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget { ...@@ -58,7 +57,6 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
this.isVisible = false; this.isVisible = false;
this.showAtPosition = null; this.showAtPosition = null;
this.highlightDecorations = [];
this.editor.addContentWidget(this); this.editor.addContentWidget(this);
} }
...@@ -93,17 +91,6 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget { ...@@ -93,17 +91,6 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
} }
// show it // show it
this.highlightDecorations = this.editor.deltaDecorations(this.highlightDecorations, [{
range: {
startLineNumber: pos.lineNumber,
endLineNumber: pos.lineNumber,
startColumn: pos.column,
endColumn: pos.column
},
options: {
className: 'hoverHighlight'
}
}]);
this.doShow(pos, expression); this.doShow(pos, expression);
}, errors.onUnexpectedError); }, errors.onUnexpectedError);
} }
...@@ -148,22 +135,22 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget { ...@@ -148,22 +135,22 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
} }
private doShow(position: editorcommon.IEditorPosition, expression: debug.IExpression, forceValueHover = false): void { private doShow(position: editorcommon.IEditorPosition, expression: debug.IExpression, forceValueHover = false): void {
this.showAtPosition = position;
this.isVisible = true;
if (expression.reference > 0 && !forceValueHover) { 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(() => {
this.layoutTree(); this.layoutTree();
}).done(null, errors.onUnexpectedError); }).then(() => this.editor.layoutContentWidget(this), errors.onUnexpectedError);
} else { } else {
this.treeContainer.hidden = true; this.treeContainer.hidden = true;
this.valueContainer.hidden = false; this.valueContainer.hidden = false;
viewer.renderExpressionValue(expression, false, this.valueContainer, false); viewer.renderExpressionValue(expression, false, this.valueContainer, false);
this.valueContainer.title = ''; this.valueContainer.title = '';
this.editor.layoutContentWidget(this);
} }
this.showAtPosition = position;
this.isVisible = true;
this.editor.layoutContentWidget(this);
} }
private layoutTree(): void { private layoutTree(): void {
...@@ -191,8 +178,6 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget { ...@@ -191,8 +178,6 @@ export class DebugHoverWidget implements editorbrowser.IContentWidget {
return; return;
} }
this.isVisible = false; this.isVisible = false;
this.editor.deltaDecorations(this.highlightDecorations, []);
this.highlightDecorations = [];
this.editor.layoutContentWidget(this); this.editor.layoutContentWidget(this);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册