@@ -195,7 +195,9 @@ export class ContentHoverController extends Disposable {
195
195
196
196
private _setCurrentResult ( hoverResult : HoverResult | null ) : void {
197
197
if ( this . _currentResult === hoverResult ) {
198
- // avoid updating the DOM to avoid resetting the user selection
198
+ if ( hoverResult === null && ! this . _widget . isFocused ) {
199
+ this . _widget . hide ( ) ;
200
+ }
199
201
return ;
200
202
}
201
203
if ( hoverResult && hoverResult . messages . length === 0 ) {
@@ -205,6 +207,9 @@ export class ContentHoverController extends Disposable {
205
207
if ( this . _currentResult ) {
206
208
this . _renderMessages ( this . _currentResult . anchor , this . _currentResult . messages ) ;
207
209
} else {
210
+ if ( this . _widget . isFocused ) {
211
+ return ;
212
+ }
208
213
this . _widget . hide ( ) ;
209
214
}
210
215
}
@@ -479,6 +484,10 @@ export class ContentHoverWidget extends ResizableContentWidget {
479
484
return this . _hoverVisibleKey . get ( ) ?? false ;
480
485
}
481
486
487
+ public get isFocused ( ) : boolean {
488
+ return this . _hoverFocusedKey . get ( ) ?? false ;
489
+ }
490
+
482
491
constructor (
483
492
editor : ICodeEditor ,
484
493
@IContextKeyService contextKeyService : IContextKeyService
@@ -727,10 +736,7 @@ export class ContentHoverWidget extends ResizableContentWidget {
727
736
}
728
737
729
738
public hide ( ) : void {
730
- if ( ! this . _visibleData ) {
731
- return ;
732
- }
733
- const stoleFocus = this . _visibleData . stoleFocus ;
739
+ const stoleFocus = this . _visibleData ?. stoleFocus ;
734
740
this . _setHoverData ( undefined ) ;
735
741
this . _resizableNode . maxSize = new dom . Dimension ( Infinity , Infinity ) ;
736
742
this . _resizableNode . clearSashHoverState ( ) ;
0 commit comments