More robust highlighting

This commit is contained in:
Aleksey Kladov 2018-08-28 00:20:59 +03:00
parent 010075be6a
commit 8f5330cb07
4 changed files with 38 additions and 3 deletions

View file

@ -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<Decoration[]>("m/decorationsRequest", params)
setHighlights(editor, decorations)
})
}
// We need to order this after LS updates, but there's no API for that.