@@ -30,7 +30,7 @@ export class ContentHoverController extends Disposable {
3030
3131 private readonly _participants : IEditorHoverParticipant [ ] ;
3232
33- private readonly _widget = this . _register ( this . _instantiationService . createInstance ( ContentHoverWidget , this . _editor ) ) ;
33+ private readonly _widget : ContentHoverWidget ;
3434
3535 getWidgetContent ( ) : string | undefined {
3636 const node = this . _widget . getDomNode ( ) ;
@@ -52,6 +52,11 @@ export class ContentHoverController extends Disposable {
5252 ) {
5353 super ( ) ;
5454
55+ const minimumHeight = this . _editor . getOption ( EditorOption . lineHeight ) + 8 ;
56+ const minimumWidth = 4 / 3 * minimumHeight ;
57+ const minimumSize = new dom . Dimension ( minimumWidth , minimumHeight ) ;
58+ this . _widget = this . _register ( this . _instantiationService . createInstance ( ContentHoverWidget , this . _editor , minimumSize ) ) ;
59+
5560 // Instantiate participants and sort them by `hoverOrdinal` which is relevant for rendering order.
5661 this . _participants = [ ] ;
5762 for ( const participant of HoverParticipantRegistry . getAll ( ) ) {
@@ -490,9 +495,10 @@ export class ContentHoverWidget extends ResizableContentWidget {
490495
491496 constructor (
492497 editor : ICodeEditor ,
498+ minimumSize : dom . Dimension ,
493499 @IContextKeyService contextKeyService : IContextKeyService
494500 ) {
495- super ( editor ) ;
501+ super ( editor , minimumSize ) ;
496502 this . _hoverVisibleKey = EditorContextKeys . hoverVisible . bindTo ( contextKeyService ) ;
497503 this . _hoverFocusedKey = EditorContextKeys . hoverFocused . bindTo ( contextKeyService ) ;
498504
0 commit comments