Skip to content

Commit 3156f1f

Browse files
committed
1 parent c12ec27 commit 3156f1f

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/vs/workbench/contrib/debug/browser/debugHover.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ import { EvaluatableExpressionProviderRegistry } from 'vs/editor/common/modes';
3434
import { CancellationToken } from 'vs/base/common/cancellation';
3535

3636
const $ = dom.$;
37-
const MAX_TREE_HEIGHT = 324;
3837

3938
async function doFindExpression(container: IExpressionContainer, namesToFind: string[]): Promise<IExpression | null> {
4039
if (!container) {
@@ -140,7 +139,7 @@ export class DebugHoverWidget implements IContentWidget {
140139
this.domNode.style.color = '';
141140
}
142141
}));
143-
this.toDispose.push(this.tree.onDidChangeContentHeight(() => this.layoutTreeAndContainer()));
142+
this.toDispose.push(this.tree.onDidChangeContentHeight(() => this.layoutTreeAndContainer(false)));
144143

145144
this.registerListeners();
146145
this.editor.addContentWidget(this);
@@ -285,7 +284,7 @@ export class DebugHoverWidget implements IContentWidget {
285284
await this.tree.setInput(expression);
286285
this.complexValueTitle.textContent = expression.value;
287286
this.complexValueTitle.title = expression.value;
288-
this.layoutTreeAndContainer();
287+
this.layoutTreeAndContainer(true);
289288
this.editor.layoutContentWidget(this);
290289
this.scrollbar.scanDomNode();
291290
this.tree.scrollTop = 0;
@@ -298,11 +297,11 @@ export class DebugHoverWidget implements IContentWidget {
298297
}
299298
}
300299

301-
private layoutTreeAndContainer(): void {
300+
private layoutTreeAndContainer(initialLayout: boolean): void {
302301
const scrollBarHeight = 8;
303-
const treeHeight = Math.min(MAX_TREE_HEIGHT, this.tree.contentHeight + scrollBarHeight);
302+
const treeHeight = Math.min(this.editor.getScrollHeight() / 2, this.tree.contentHeight + scrollBarHeight);
304303
this.treeContainer.style.height = `${treeHeight}px`;
305-
this.tree.layout(treeHeight, 324);
304+
this.tree.layout(treeHeight, initialLayout ? 400 : undefined);
306305
}
307306

308307
hide(): void {

src/vs/workbench/contrib/debug/browser/media/debugHover.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
}
1717

1818
.monaco-editor .debug-hover-widget .complex-value {
19-
width: 324px;
19+
max-width: 700px;
2020
}
2121

2222
.monaco-editor .debug-hover-widget .complex-value .title {
@@ -57,12 +57,13 @@
5757
background-color: rgba(173, 214, 255, 0.15);
5858
}
5959

60-
.monaco-editor .debug-hover-widget .value {
60+
.monaco-editor .debug-hover-widget > .monaco-scrollable-element > .value {
6161
color: rgba(108, 108, 108, 0.8);
6262
overflow: auto;
6363
font-family: var(--monaco-monospace-font);
6464
max-height: 500px;
6565
padding: 4px 5px;
66+
white-space: pre-wrap;
6667
}
6768

6869
.monaco-editor.vs-dark .debugHoverHighlight,

0 commit comments

Comments
 (0)