aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/highlighting.ts
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-02-17 12:54:33 +0000
committerGitHub <[email protected]>2020-02-17 12:54:33 +0000
commit6167101302bcc2d7f1a345e0ee44e1411056b4b3 (patch)
treedf40b6265f303b8fba5f804a7f7ff370e844dea0 /editors/code/src/highlighting.ts
parentfcf15cc05afaeda6880664777ff2a3db342ea088 (diff)
parentd24e612106867c4bb6a1e59bf99aabfb7bc27823 (diff)
Merge pull request #3190 from matklad/reload
Simplify TS reload logic
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 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
8export function activateHighlighting(ctx: Ctx) { 8export 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(),