@@ -34,7 +34,6 @@ import { EvaluatableExpressionProviderRegistry } from 'vs/editor/common/modes';
3434import { CancellationToken } from 'vs/base/common/cancellation' ;
3535
3636const $ = dom . $ ;
37- const MAX_TREE_HEIGHT = 324 ;
3837
3938async 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 {
0 commit comments