@@ -9,7 +9,7 @@ import { coalesce } from 'vs/base/common/arrays';
9
9
import { CancellationToken } from 'vs/base/common/cancellation' ;
10
10
import { KeyCode } from 'vs/base/common/keyCodes' ;
11
11
import { Disposable , DisposableStore , toDisposable } from 'vs/base/common/lifecycle' ;
12
- import { ContentWidgetPositionPreference , IActiveCodeEditor , ICodeEditor , IContentWidgetPosition , IEditorMouseEvent , MouseTargetType } from 'vs/editor/browser/editorBrowser' ;
12
+ import { ContentWidgetPositionPreference , IActiveCodeEditor , ICodeEditor , IEditorMouseEvent , MouseTargetType } from 'vs/editor/browser/editorBrowser' ;
13
13
import { ConfigurationChangedEvent , EditorOption } from 'vs/editor/common/config/editorOptions' ;
14
14
import { Position } from 'vs/editor/common/core/position' ;
15
15
import { Range } from 'vs/editor/common/core/range' ;
@@ -689,14 +689,9 @@ export class ResizableHoverWidget extends MultiplePersistedSizeResizableContentW
689
689
690
690
private _updateContentsDomNodeMaxDimensions ( ) {
691
691
const persistedSize = this . findPersistedSize ( ) ;
692
- if ( ! persistedSize ) {
693
- this . _setContentsDomNodeMaxDimensions (
694
- Math . max ( this . _editor . getLayoutInfo ( ) . width * 0.66 , 500 ) ,
695
- Math . max ( this . _editor . getLayoutInfo ( ) . height / 4 , 250 ) ) ;
696
- }
697
- else {
698
- this . _setContentsDomNodeMaxDimensions ( 'none' , 'none' ) ;
699
- }
692
+ const width = persistedSize ? 'none' : Math . max ( this . _editor . getLayoutInfo ( ) . width * 0.66 , 500 ) ;
693
+ const height = persistedSize ? 'none' : Math . max ( this . _editor . getLayoutInfo ( ) . height / 4 , 250 ) ;
694
+ this . _setContentsDomNodeMaxDimensions ( width , height ) ;
700
695
}
701
696
702
697
private _render ( node : DocumentFragment , visibleData : ContentHoverData ) {
@@ -716,13 +711,12 @@ export class ResizableHoverWidget extends MultiplePersistedSizeResizableContentW
716
711
}
717
712
718
713
private _setContentPosition ( visibleData : ContentHoverData , preference ?: ContentWidgetPositionPreference ) {
719
- const widgetPosition : IContentWidgetPosition = {
714
+ this . _contentPosition = {
720
715
position : visibleData . showAtPosition ,
721
716
secondaryPosition : visibleData . showAtSecondaryPosition ,
722
717
positionAffinity : visibleData . isBeforeContent ? PositionAffinity . LeftOfInjectedText : undefined ,
723
718
preference : [ preference ?? ContentWidgetPositionPreference . ABOVE ]
724
719
} ;
725
- this . _contentPosition = widgetPosition ;
726
720
}
727
721
728
722
public showAt ( node : DocumentFragment , visibleData : ContentHoverData ) : void {
0 commit comments