@@ -450,12 +450,11 @@ export class ContentHoverWidget extends ResizableContentWidget {
450
450
451
451
public static ID = 'editor.contrib.resizableContentHoverWidget' ;
452
452
453
- private _disposableStore = new DisposableStore ( ) ;
454
453
private _visibleData : ContentHoverVisibleData | undefined ;
455
454
private _positionPreference : ContentWidgetPositionPreference | undefined ;
456
455
private _position : Position | undefined ;
457
456
458
- private readonly _hover : HoverWidget = this . _disposableStore . add ( new HoverWidget ( ) ) ;
457
+ private readonly _hover : HoverWidget = this . _register ( new HoverWidget ( ) ) ;
459
458
private readonly _hoverVisibleKey : IContextKey < boolean > ;
460
459
private readonly _hoverFocusedKey : IContextKey < boolean > ;
461
460
@@ -490,17 +489,17 @@ export class ContentHoverWidget extends ResizableContentWidget {
490
489
dom . append ( this . _resizableNode . domNode , this . _hover . containerDomNode ) ;
491
490
this . _resizableNode . domNode . style . zIndex = '50' ;
492
491
493
- this . _disposableStore . add ( this . _editor . onDidLayoutChange ( ( ) => this . _layout ( ) ) ) ;
494
- this . _disposableStore . add ( this . _editor . onDidChangeConfiguration ( ( e : ConfigurationChangedEvent ) => {
492
+ this . _register ( this . _editor . onDidLayoutChange ( ( ) => this . _layout ( ) ) ) ;
493
+ this . _register ( this . _editor . onDidChangeConfiguration ( ( e : ConfigurationChangedEvent ) => {
495
494
if ( e . hasChanged ( EditorOption . fontInfo ) ) {
496
495
this . _updateFont ( ) ;
497
496
}
498
497
} ) ) ;
499
- const focusTracker = this . _disposableStore . add ( dom . trackFocus ( this . _resizableNode . domNode ) ) ;
500
- this . _disposableStore . add ( focusTracker . onDidFocus ( ( ) => {
498
+ const focusTracker = this . _register ( dom . trackFocus ( this . _resizableNode . domNode ) ) ;
499
+ this . _register ( focusTracker . onDidFocus ( ( ) => {
501
500
this . _hoverFocusedKey . set ( true ) ;
502
501
} ) ) ;
503
- this . _disposableStore . add ( focusTracker . onDidBlur ( ( ) => {
502
+ this . _register ( focusTracker . onDidBlur ( ( ) => {
504
503
this . _hoverFocusedKey . set ( false ) ;
505
504
} ) ) ;
506
505
this . _setHoverData ( undefined ) ;
@@ -510,7 +509,6 @@ export class ContentHoverWidget extends ResizableContentWidget {
510
509
public override dispose ( ) : void {
511
510
super . dispose ( ) ;
512
511
this . _visibleData ?. disposables . dispose ( ) ;
513
- this . _disposableStore . dispose ( ) ;
514
512
this . _editor . removeContentWidget ( this ) ;
515
513
}
516
514
0 commit comments