From ae531ff78ca1579f0a7b3f134713a32e8b57fbce Mon Sep 17 00:00:00 2001 From: nsingh Date: Fri, 4 May 2018 18:31:24 -0700 Subject: [PATCH] Show live hovers on all open editors in vscode --- .../commons-vscode/src/highlight-service.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/vscode-extensions/commons-vscode/src/highlight-service.ts b/vscode-extensions/commons-vscode/src/highlight-service.ts index 81b8e265a..cd7915166 100644 --- a/vscode-extensions/commons-vscode/src/highlight-service.ts +++ b/vscode-extensions/commons-vscode/src/highlight-service.ts @@ -41,13 +41,15 @@ export class HighlightService { } refresh(uri : String) { - let editor = VSCode.window.activeTextEditor; - let activeUri = editor.document.uri.toString(); - if (uri===activeUri) { - //We only update highlights in the active editor for now - let highlights : Range[] = this.highlights.get(uri) || []; - let decorations = highlights.map(hl => toDecoration(hl)); - editor.setDecorations(this.DECORATION, decorations); + let editors = VSCode.window.visibleTextEditors; + for (let editor of editors) { + let activeUri = editor.document.uri.toString(); + if (uri===activeUri) { + //We only update highlights in the active editor for now + let highlights : Range[] = this.highlights.get(uri) || []; + let decorations = highlights.map(hl => toDecoration(hl)); + editor.setDecorations(this.DECORATION, decorations); + } } } } \ No newline at end of file