@@ -155,7 +155,7 @@ export class ModesHoverController implements IEditorContribution {
155
155
private _onEditorMouseMove ( mouseEvent : IEditorMouseEvent ) : void {
156
156
const target = mouseEvent . target ;
157
157
158
- if ( this . _contentWidget ?. isFocused ( ) || this . _contentWidget ?. widget . isResizing ) {
158
+ if ( this . _contentWidget ?. isFocused || this . _contentWidget ?. isResizing ) {
159
159
return ;
160
160
}
161
161
@@ -175,7 +175,7 @@ export class ModesHoverController implements IEditorContribution {
175
175
176
176
if (
177
177
! this . _isHoverSticky && target . type === MouseTargetType . CONTENT_WIDGET && target . detail === ContentHoverWidget . ID
178
- && this . _contentWidget ?. isColorPickerVisible ( )
178
+ && this . _contentWidget ?. isColorPickerVisible
179
179
) {
180
180
// though the hover is not sticky, the color picker needs to.
181
181
return ;
@@ -186,7 +186,7 @@ export class ModesHoverController implements IEditorContribution {
186
186
return ;
187
187
}
188
188
189
- if ( this . _isHoverSticky && this . _contentWidget ?. isVisibleFromKeyboard ( ) ) {
189
+ if ( this . _isHoverSticky && this . _contentWidget ?. isVisibleFromKeyboard ) {
190
190
// Sticky mode is on and the hover has been shown via keyboard
191
191
// so moving the mouse has no effect
192
192
return ;
@@ -233,7 +233,7 @@ export class ModesHoverController implements IEditorContribution {
233
233
234
234
const resolvedKeyboardEvent = this . _keybindingService . softDispatch ( e , this . _editor . getDomNode ( ) ) ;
235
235
// If the beginning of a multi-chord keybinding is pressed, or the command aims to focus the hover, set the variable to true, otherwise false
236
- const mightTriggerFocus = ( resolvedKeyboardEvent . kind === ResultKind . MoreChordsNeeded || ( resolvedKeyboardEvent . kind === ResultKind . KbFound && resolvedKeyboardEvent . commandId === 'editor.action.showHover' && this . _contentWidget ?. isVisible ( ) ) ) ;
236
+ const mightTriggerFocus = ( resolvedKeyboardEvent . kind === ResultKind . MoreChordsNeeded || ( resolvedKeyboardEvent . kind === ResultKind . KbFound && resolvedKeyboardEvent . commandId === 'editor.action.showHover' && this . _contentWidget ?. isVisible ) ) ;
237
237
238
238
if ( e . keyCode !== KeyCode . Ctrl && e . keyCode !== KeyCode . Alt && e . keyCode !== KeyCode . Meta && e . keyCode !== KeyCode . Shift
239
239
&& ! mightTriggerFocus ) {
@@ -246,7 +246,7 @@ export class ModesHoverController implements IEditorContribution {
246
246
if ( _sticky ) {
247
247
return ;
248
248
}
249
- if ( ( this . _isMouseDown && this . _hoverClicked && this . _contentWidget ?. isColorPickerVisible ( ) ) || InlineSuggestionHintsContentWidget . dropDownVisible ) {
249
+ if ( ( this . _isMouseDown && this . _hoverClicked && this . _contentWidget ?. isColorPickerVisible ) || InlineSuggestionHintsContentWidget . dropDownVisible ) {
250
250
return ;
251
251
}
252
252
this . _hoverActivatedByColorDecoratorClick = false ;
@@ -262,10 +262,6 @@ export class ModesHoverController implements IEditorContribution {
262
262
return this . _contentWidget ;
263
263
}
264
264
265
- public isColorPickerVisible ( ) : boolean {
266
- return this . _contentWidget ?. isColorPickerVisible ( ) || false ;
267
- }
268
-
269
265
public showContentHover ( range : Range , mode : HoverStartMode , source : HoverStartSource , focus : boolean , activatedByColorDecoratorClick : boolean = false ) : void {
270
266
this . _hoverActivatedByColorDecoratorClick = activatedByColorDecoratorClick ;
271
267
this . _getOrCreateContentWidget ( ) . startShowingAtRange ( range , mode , source , focus ) ;
@@ -307,8 +303,12 @@ export class ModesHoverController implements IEditorContribution {
307
303
this . _contentWidget ?. goToBottom ( ) ;
308
304
}
309
305
310
- public isHoverVisible ( ) : boolean | undefined {
311
- return this . _contentWidget ?. isVisible ( ) ;
306
+ get isColorPickerVisible ( ) : boolean | undefined {
307
+ return this . _contentWidget ?. isColorPickerVisible ;
308
+ }
309
+
310
+ get isHoverVisible ( ) : boolean | undefined {
311
+ return this . _contentWidget ?. isVisible ;
312
312
}
313
313
314
314
public dispose ( ) : void {
@@ -372,7 +372,7 @@ class ShowOrFocusHoverAction extends EditorAction {
372
372
const range = new Range ( position . lineNumber , position . column , position . lineNumber , position . column ) ;
373
373
const focus = editor . getOption ( EditorOption . accessibilitySupport ) === AccessibilitySupport . Enabled || ! ! args ?. focus ;
374
374
375
- if ( controller . isHoverVisible ( ) ) {
375
+ if ( controller . isHoverVisible ) {
376
376
controller . focus ( ) ;
377
377
} else {
378
378
controller . showContentHover ( range , HoverStartMode . Immediate , HoverStartSource . Keyboard , focus ) ;
0 commit comments