mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-14 18:46:34 -05:00
Merge from vscode 3d67364fbfcf676d93be64f949e9b33e7f1b969e (#5028)
This commit is contained in:
@@ -250,7 +250,8 @@ export class DebugHoverWidget implements IContentWidget {
|
||||
}
|
||||
|
||||
private layoutTreeAndContainer(): void {
|
||||
const treeHeight = Math.min(MAX_TREE_HEIGHT, this.tree.contentHeight);
|
||||
const scrollBarHeight = 8;
|
||||
const treeHeight = Math.min(MAX_TREE_HEIGHT, this.tree.contentHeight + scrollBarHeight);
|
||||
this.treeContainer.style.height = `${treeHeight}px`;
|
||||
this.tree.layout(treeHeight, 324);
|
||||
}
|
||||
|
||||
@@ -720,11 +720,25 @@ class ReplDelegate implements IListVirtualDelegate<IReplElement> {
|
||||
getHeight(element: IReplElement): number {
|
||||
// Give approximate heights. Repl has dynamic height so the tree will measure the actual height on its own.
|
||||
const fontSize = this.configurationService.getValue<IDebugConfiguration>('debug').console.fontSize;
|
||||
const rowHeight = Math.ceil(1.4 * fontSize);
|
||||
if (element instanceof Expression && element.hasChildren) {
|
||||
return Math.ceil(2 * 1.4 * fontSize);
|
||||
return 2 * rowHeight;
|
||||
}
|
||||
|
||||
return Math.ceil(1.4 * fontSize);
|
||||
// In order to keep scroll position we need to give a good approximation to the tree
|
||||
if (element instanceof SimpleReplElement) {
|
||||
// For every 150 characters increase the number of lines needed
|
||||
let count = Math.ceil(element.value.length / 150);
|
||||
for (let i = 0; i < element.value.length; i++) {
|
||||
if (element.value[i] === '\n' || element.value[i] === '\r\n') {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return Math.max(1, count) * rowHeight;
|
||||
}
|
||||
|
||||
return rowHeight;
|
||||
}
|
||||
|
||||
getTemplateId(element: IReplElement): string {
|
||||
|
||||
Reference in New Issue
Block a user