Skip to content

Commit

Permalink
Merge pull request #23211 from cristianhosu/#22622
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn authored Jun 14, 2017
2 parents 5b6f2fa + 5000246 commit 6a26c57
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/vs/workbench/parts/debug/browser/media/debugHover.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
word-break: normal;
text-overflow: ellipsis;
height: 18px;
overflow: hidden;
overflow: auto;
border-bottom: 1px solid rgba(128, 128, 128, 0.35);
}

Expand Down Expand Up @@ -64,6 +64,8 @@
.monaco-editor .debug-hover-widget .value {
white-space: pre-wrap;
color: rgba(108, 108, 108, 0.8);
overflow: auto;
max-height: 500px;
}

.monaco-editor .debug-hover-widget .error {
Expand Down
10 changes: 7 additions & 3 deletions src/vs/workbench/parts/debug/electron-browser/debugHover.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import { IDebugService, IExpression, IExpressionContainer } from 'vs/workbench/p
import { Expression } from 'vs/workbench/parts/debug/common/debugModel';
import { VariablesRenderer, renderExpressionValue, VariablesDataSource } from 'vs/workbench/parts/debug/electron-browser/debugViewer';
import { IListService } from 'vs/platform/list/browser/listService';
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
import { attachListStyler, attachStylerCallback } from 'vs/platform/theme/common/styler';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/common/colorRegistry';

const $ = dom.$;
const MAX_ELEMENTS_SHOWN = 18;
const MAX_VALUE_RENDER_LENGTH_IN_HOVER = 4096;

export class DebugHoverWidget implements IContentWidget {

Expand All @@ -46,6 +46,7 @@ export class DebugHoverWidget implements IContentWidget {
private valueContainer: HTMLElement;
private stoleFocus: boolean;
private toDispose: lifecycle.IDisposable[];
private scrollbar: DomScrollableElement;

constructor(
private editor: ICodeEditor,
Expand All @@ -58,9 +59,12 @@ export class DebugHoverWidget implements IContentWidget {
this.create(instantiationService);
this.registerListeners();

this.valueContainer = dom.append(this.domNode, $('.value'));
this.valueContainer = $('.value');
this.valueContainer.tabIndex = 0;
this.valueContainer.setAttribute('role', 'tooltip');
this.scrollbar = new DomScrollableElement(this.valueContainer, { canUseTranslate3d: false });
this.domNode.appendChild(this.scrollbar.getDomNode());
this.toDispose.push(this.scrollbar);

this._isVisible = false;
this.showAtPosition = null;
Expand Down Expand Up @@ -249,9 +253,9 @@ export class DebugHoverWidget implements IContentWidget {
this.valueContainer.hidden = false;
renderExpressionValue(expression, this.valueContainer, {
showChanged: false,
maxValueLength: MAX_VALUE_RENDER_LENGTH_IN_HOVER,
preserveWhitespace: true
});
this.scrollbar.scanDomNode();
this.valueContainer.title = '';
this.editor.layoutContentWidget(this);
if (focus) {
Expand Down

0 comments on commit 6a26c57

Please sign in to comment.