Privatize highlighting

This commit is contained in:
Aleksey Kladov 2019-12-30 23:12:33 +01:00
parent cdd7118cbf
commit 233f1dd2a8
8 changed files with 54 additions and 48 deletions

View file

@ -4,7 +4,6 @@ import * as lc from 'vscode-languageclient';
import * as commands from './commands';
import { activateInlayHints } from './inlay_hints';
import { StatusDisplay } from './status_display';
import * as notifications from './notifications';
import { Server } from './server';
import { Ctx } from './ctx';
import { activateHighlighting } from './highlighting';
@ -35,14 +34,8 @@ export async function activate(context: vscode.ExtensionContext) {
const watchStatus = new StatusDisplay(ctx.config.cargoWatchOptions.command);
ctx.pushCleanup(watchStatus);
activateHighlighting(ctx);
// Notifications are events triggered by the language server
const allNotifications: [string, lc.GenericNotificationHandler][] = [
[
'rust-analyzer/publishDecorations',
notifications.publishDecorations.handle,
],
[
'$/progress',
params => watchStatus.handleProgressNotification(params),
@ -61,6 +54,8 @@ export async function activate(context: vscode.ExtensionContext) {
vscode.window.showErrorMessage(e.message);
}
activateHighlighting(ctx);
if (ctx.config.displayInlayHints) {
activateInlayHints(ctx);
}