diff --git a/src/vs/workbench/services/hover/browser/hoverService.ts b/src/vs/workbench/services/hover/browser/hoverService.ts index f0a3c2487f4c7..37cd88393a302 100644 --- a/src/vs/workbench/services/hover/browser/hoverService.ts +++ b/src/vs/workbench/services/hover/browser/hoverService.ts @@ -38,7 +38,11 @@ export class HoverService implements IHoverService { const hoverDisposables = new DisposableStore(); const hover = this._instantiationService.createInstance(HoverWidget, options); hover.onDispose(() => { - this._currentHoverOptions = undefined; + // Only clear the current options if it's the current hover, the current options help + // reduce flickering when the same hover is shown multiple times + if (this._currentHoverOptions === options) { + this._currentHoverOptions = undefined; + } hoverDisposables.dispose(); }); const provider = this._contextViewService as IContextViewProvider; diff --git a/src/vs/workbench/services/hover/browser/hoverWidget.ts b/src/vs/workbench/services/hover/browser/hoverWidget.ts index 24f4173e3f87b..738c5acb24512 100644 --- a/src/vs/workbench/services/hover/browser/hoverWidget.ts +++ b/src/vs/workbench/services/hover/browser/hoverWidget.ts @@ -507,7 +507,7 @@ export class HoverWidget extends Widget { } class CompositeMouseTracker extends Widget { - private _isMouseIn: boolean = false; + private _isMouseIn: boolean = true; private _mouseTimeout: number | undefined; private readonly _onMouseOut = this._register(new Emitter());