From 193a4f8495d5b0f4621548fdf3f5f2e102f0b2aa Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 30 Apr 2019 23:23:25 -0400 Subject: [PATCH] Fixes issues with hovers not showing up sometimes --- src/hovers/lineHoverController.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/hovers/lineHoverController.ts b/src/hovers/lineHoverController.ts index 5cf06df..40d76a9 100644 --- a/src/hovers/lineHoverController.ts +++ b/src/hovers/lineHoverController.ts @@ -55,7 +55,7 @@ export class LineHoverController implements Disposable { } private onActiveLinesChanged(e: LinesChangeEvent) { - if (e.pending || e.reason !== 'editor') return; + if (e.pending) return; if (e.editor === undefined || e.lines === undefined) { this.unregister(); @@ -63,9 +63,15 @@ export class LineHoverController implements Disposable { return; } + if (e.reason !== 'editor' && this.registered) return; + this.register(e.editor); } + get registered() { + return this._hoverProviderDisposable !== undefined; + } + async provideDetailsHover( document: TextDocument, position: Position,