aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/highlighting.ts
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-02-17 12:40:20 +0000
committerAleksey Kladov <[email protected]>2020-02-17 12:40:47 +0000
commitd24e612106867c4bb6a1e59bf99aabfb7bc27823 (patch)
treedf40b6265f303b8fba5f804a7f7ff370e844dea0 /editors/code/src/highlighting.ts
parentdcdbbddd1630a4ed01906c2aff0e2b65ed99a591 (diff)
Simplify startup
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(),