mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Encapsulate highlighting activation
This commit is contained in:
parent
17dda0972a
commit
7646dc046e
4 changed files with 24 additions and 35 deletions
|
@ -4,10 +4,10 @@ import * as lc from 'vscode-languageclient';
|
|||
import * as commands from './commands';
|
||||
import { activateInlayHints } from './inlay_hints';
|
||||
import { StatusDisplay } from './status_display';
|
||||
import * as events from './events';
|
||||
import * as notifications from './notifications';
|
||||
import { Server } from './server';
|
||||
import { Ctx } from './ctx';
|
||||
import { activateHighlighting } from './highlighting';
|
||||
|
||||
let ctx!: Ctx;
|
||||
|
||||
|
@ -37,6 +37,8 @@ export async function activate(context: vscode.ExtensionContext) {
|
|||
);
|
||||
ctx.pushCleanup(watchStatus);
|
||||
|
||||
activateHighlighting(ctx);
|
||||
|
||||
// Notifications are events triggered by the language server
|
||||
const allNotifications: [string, lc.GenericNotificationHandler][] = [
|
||||
[
|
||||
|
@ -49,11 +51,6 @@ export async function activate(context: vscode.ExtensionContext) {
|
|||
],
|
||||
];
|
||||
|
||||
// The events below are plain old javascript events, triggered and handled by vscode
|
||||
vscode.window.onDidChangeActiveTextEditor(
|
||||
events.changeActiveTextEditor.makeHandler(),
|
||||
);
|
||||
|
||||
const startServer = () => Server.start(allNotifications);
|
||||
const reloadCommand = () => reloadServer(startServer);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue