Simplify startup

This commit is contained in:
Aleksey Kladov 2020-02-17 13:40:20 +01:00
parent dcdbbddd16
commit d24e612106
5 changed files with 25 additions and 33 deletions

View file

@ -7,7 +7,8 @@ import { Ctx, sendRequestWithRetry } from './ctx';
export function activateHighlighting(ctx: Ctx) {
const highlighter = new Highlighter(ctx);
ctx.onStart(client => {
const client = ctx.client;
if (client != null) {
client.onNotification(
'rust-analyzer/publishDecorations',
(params: PublishDecorationsParams) => {
@ -28,7 +29,7 @@ export function activateHighlighting(ctx: Ctx) {
highlighter.setHighlights(targetEditor, params.decorations);
},
);
});
};
vscode.workspace.onDidChangeConfiguration(
_ => highlighter.removeHighlights(),