Skip to content

Commit d9a8a36

Browse files
authored
[Debt] Removing the useless contentHoverFocused IHoverState field (microsoft#209425)
removing the useless parameter
1 parent 7fe1706 commit d9a8a36

File tree

1 file changed

+4
-20
lines changed
  • src/vs/editor/contrib/hover/browser

1 file changed

+4
-20
lines changed

src/vs/editor/contrib/hover/browser/hover.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ interface IHoverSettings {
4646

4747
interface IHoverState {
4848
mouseDown: boolean;
49-
// TODO @aiday-mar maybe not needed, investigate this
50-
contentHoverFocused: boolean;
5149
activatedByDecoratorClick: boolean;
5250
}
5351

@@ -66,7 +64,6 @@ export class HoverController extends Disposable implements IEditorContribution {
6664
private _hoverSettings!: IHoverSettings;
6765
private _hoverState: IHoverState = {
6866
mouseDown: false,
69-
contentHoverFocused: false,
7067
activatedByDecoratorClick: false
7168
};
7269

@@ -146,7 +143,6 @@ export class HoverController extends Disposable implements IEditorContribution {
146143

147144
if (target.type === MouseTargetType.CONTENT_WIDGET && target.detail === ContentHoverWidget.ID) {
148145
// mouse down on top of content hover widget
149-
this._hoverState.contentHoverFocused = true;
150146
return;
151147
}
152148

@@ -155,10 +151,6 @@ export class HoverController extends Disposable implements IEditorContribution {
155151
return;
156152
}
157153

158-
if (target.type !== MouseTargetType.OVERLAY_WIDGET) {
159-
this._hoverState.contentHoverFocused = false;
160-
}
161-
162154
if (this._contentWidget?.widget.isResizing) {
163155
return;
164156
}
@@ -232,9 +224,6 @@ export class HoverController extends Disposable implements IEditorContribution {
232224
if (this._contentWidget?.isFocused || this._contentWidget?.isResizing) {
233225
return;
234226
}
235-
if (this._hoverState.mouseDown && this._hoverState.contentHoverFocused) {
236-
return;
237-
}
238227
const sticky = this._hoverSettings.sticky;
239228
if (sticky && this._contentWidget?.isVisibleFromKeyboard) {
240229
// Sticky mode is on and the hover has been shown via keyboard
@@ -348,18 +337,13 @@ export class HoverController extends Disposable implements IEditorContribution {
348337
if (_sticky) {
349338
return;
350339
}
351-
if (
352-
(
353-
this._hoverState.mouseDown
354-
&& this._hoverState.contentHoverFocused
355-
&& this._contentWidget?.isColorPickerVisible
356-
)
357-
|| InlineSuggestionHintsContentWidget.dropDownVisible
358-
) {
340+
if ((
341+
this._hoverState.mouseDown
342+
&& this._contentWidget?.isColorPickerVisible
343+
) || InlineSuggestionHintsContentWidget.dropDownVisible) {
359344
return;
360345
}
361346
this._hoverState.activatedByDecoratorClick = false;
362-
this._hoverState.contentHoverFocused = false;
363347
this._glyphWidget?.hide();
364348
this._contentWidget?.hide();
365349
}

0 commit comments

Comments
 (0)