aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/main.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r--editors/code/src/main.ts19
1 files changed, 8 insertions, 11 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 1da10ebd0..a4149a059 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -9,8 +9,16 @@ import { StatusDisplay } from './commands/watch_status';
9import * as events from './events'; 9import * as events from './events';
10import * as notifications from './notifications'; 10import * as notifications from './notifications';
11import { Server } from './server'; 11import { Server } from './server';
12import { Ctx } from './ctx';
13
14let ctx!: Ctx;
12 15
13export async function activate(context: vscode.ExtensionContext) { 16export async function activate(context: vscode.ExtensionContext) {
17 ctx = new Ctx(context);
18 ctx.registerCommand('analyzerStatus', commands.analyzerStatus);
19 ctx.registerCommand('collectGarbage', commands.collectGarbage);
20 ctx.registerCommand('matchingBrace', commands.matchingBrace);
21
14 function disposeOnDeactivation(disposable: vscode.Disposable) { 22 function disposeOnDeactivation(disposable: vscode.Disposable) {
15 context.subscriptions.push(disposable); 23 context.subscriptions.push(disposable);
16 } 24 }
@@ -48,17 +56,6 @@ export async function activate(context: vscode.ExtensionContext) {
48 } 56 }
49 57
50 // Commands are requests from vscode to the language server 58 // Commands are requests from vscode to the language server
51 registerCommand(
52 'rust-analyzer.analyzerStatus',
53 commands.analyzerStatus.makeCommand(context),
54 );
55 registerCommand('rust-analyzer.collectGarbage', () =>
56 Server.client.sendRequest<null>('rust-analyzer/collectGarbage', null),
57 );
58 registerCommand(
59 'rust-analyzer.matchingBrace',
60 commands.matchingBrace.handle,
61 );
62 registerCommand('rust-analyzer.joinLines', commands.joinLines.handle); 59 registerCommand('rust-analyzer.joinLines', commands.joinLines.handle);
63 registerCommand('rust-analyzer.parentModule', commands.parentModule.handle); 60 registerCommand('rust-analyzer.parentModule', commands.parentModule.handle);
64 registerCommand('rust-analyzer.run', commands.runnables.handle); 61 registerCommand('rust-analyzer.run', commands.runnables.handle);