@@ -30,7 +30,7 @@ export class ContentHoverController extends Disposable {
30
30
31
31
private readonly _participants : IEditorHoverParticipant [ ] ;
32
32
33
- private readonly _widget = this . _register ( this . _instantiationService . createInstance ( ContentHoverWidget , this . _editor ) ) ;
33
+ private readonly _widget : ContentHoverWidget ;
34
34
35
35
getWidgetContent ( ) : string | undefined {
36
36
const node = this . _widget . getDomNode ( ) ;
@@ -52,6 +52,11 @@ export class ContentHoverController extends Disposable {
52
52
) {
53
53
super ( ) ;
54
54
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
+
55
60
// Instantiate participants and sort them by `hoverOrdinal` which is relevant for rendering order.
56
61
this . _participants = [ ] ;
57
62
for ( const participant of HoverParticipantRegistry . getAll ( ) ) {
@@ -490,9 +495,10 @@ export class ContentHoverWidget extends ResizableContentWidget {
490
495
491
496
constructor (
492
497
editor : ICodeEditor ,
498
+ minimumSize : dom . Dimension ,
493
499
@IContextKeyService contextKeyService : IContextKeyService
494
500
) {
495
- super ( editor ) ;
501
+ super ( editor , minimumSize ) ;
496
502
this . _hoverVisibleKey = EditorContextKeys . hoverVisible . bindTo ( contextKeyService ) ;
497
503
this . _hoverFocusedKey = EditorContextKeys . hoverFocused . bindTo ( contextKeyService ) ;
498
504
0 commit comments