diff options
Diffstat (limited to 'editors/code/src/highlighting.ts')
-rw-r--r-- | editors/code/src/highlighting.ts | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts index 4fbbe3ddc..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 | ||
8 | export function activateHighlighting(ctx: Ctx) { | 8 | export function activateHighlighting(ctx: Ctx) { |
9 | const highlighter = new Highlighter(ctx); | 9 | const highlighter = new Highlighter(ctx); |
10 | ctx.onDidRestart(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(), |