mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
More robust highlighting
This commit is contained in:
parent
010075be6a
commit
8f5330cb07
4 changed files with 38 additions and 3 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue