aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/highlighting.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/highlighting.ts')
-rw-r--r--editors/code/src/highlighting.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts
index f693fb8ba..a2db04de8 100644
--- a/editors/code/src/highlighting.ts
+++ b/editors/code/src/highlighting.ts
@@ -7,7 +7,8 @@ import { Ctx, sendRequestWithRetry } from './ctx';
7 7
8export function activateHighlighting(ctx: Ctx) { 8export function activateHighlighting(ctx: Ctx) {
9 const highlighter = new Highlighter(ctx); 9 const highlighter = new Highlighter(ctx);
10 ctx.onStart(client => { 10 const client = ctx.client;
11 if (client != null) {
11 client.onNotification( 12 client.onNotification(
12 'rust-analyzer/publishDecorations', 13 'rust-analyzer/publishDecorations',
13 (params: PublishDecorationsParams) => { 14 (params: PublishDecorationsParams) => {
@@ -28,7 +29,7 @@ export function activateHighlighting(ctx: Ctx) {
28 highlighter.setHighlights(targetEditor, params.decorations); 29 highlighter.setHighlights(targetEditor, params.decorations);
29 }, 30 },
30 ); 31 );
31 }); 32 };
32 33
33 vscode.workspace.onDidChangeConfiguration( 34 vscode.workspace.onDidChangeConfiguration(
34 _ => highlighter.removeHighlights(), 35 _ => highlighter.removeHighlights(),