From 8f5330cb0796670a93089107c8b15cdef3fa7c94 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 28 Aug 2018 00:20:59 +0300 Subject: More robust highlighting --- code/src/extension.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'code') diff --git a/code/src/extension.ts b/code/src/extension.ts index 554ac8af3..81153b7e6 100644 --- a/code/src/extension.ts +++ b/code/src/extension.ts @@ -134,6 +134,14 @@ export function activate(context: vscode.ExtensionContext) { textDocumentContentProvider.eventEmitter.fire(uris.syntaxTree) }) }, null, context.subscriptions) + vscode.window.onDidChangeActiveTextEditor(async (editor) => { + if (!editor || editor.document.languageId != 'rust') return + let params: lc.TextDocumentIdentifier = { + uri: editor.document.uri.toString() + } + let decorations = await client.sendRequest("m/decorationsRequest", params) + setHighlights(editor, decorations) + }) } // We need to order this after LS updates, but there's no API for that. -- cgit v1.2.3