aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/main.ts
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-30 13:42:59 +0000
committerAleksey Kladov <[email protected]>2019-12-30 13:42:59 +0000
commite53ccb6e99bb0e92ebea19f150c8fbf9b6958634 (patch)
treeac0f868655e52002f8a40015d094e0d55effa764 /editors/code/src/main.ts
parent9cad88dd95773f9ede6233fd7d0f3a076c5cda61 (diff)
Start new ctx module
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r--editors/code/src/main.ts32
1 files changed, 19 insertions, 13 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 1da10ebd0..048b9bbd4 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -9,8 +9,18 @@ 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(
19 'analyzerStatus',
20 commands.analyzerStatus
21 );
22
23
14 function disposeOnDeactivation(disposable: vscode.Disposable) { 24 function disposeOnDeactivation(disposable: vscode.Disposable) {
15 context.subscriptions.push(disposable); 25 context.subscriptions.push(disposable);
16 } 26 }
@@ -48,10 +58,6 @@ export async function activate(context: vscode.ExtensionContext) {
48 } 58 }
49 59
50 // Commands are requests from vscode to the language server 60 // 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', () => 61 registerCommand('rust-analyzer.collectGarbage', () =>
56 Server.client.sendRequest<null>('rust-analyzer/collectGarbage', null), 62 Server.client.sendRequest<null>('rust-analyzer/collectGarbage', null),
57 ); 63 );
@@ -94,15 +100,15 @@ export async function activate(context: vscode.ExtensionContext) {
94 string, 100 string,
95 lc.GenericNotificationHandler, 101 lc.GenericNotificationHandler,
96 ]> = [ 102 ]> = [
97 [ 103 [
98 'rust-analyzer/publishDecorations', 104 'rust-analyzer/publishDecorations',
99 notifications.publishDecorations.handle, 105 notifications.publishDecorations.handle,
100 ], 106 ],
101 [ 107 [
102 '$/progress', 108 '$/progress',
103 params => watchStatus.handleProgressNotification(params), 109 params => watchStatus.handleProgressNotification(params),
104 ], 110 ],
105 ]; 111 ];
106 const syntaxTreeContentProvider = new SyntaxTreeContentProvider(); 112 const syntaxTreeContentProvider = new SyntaxTreeContentProvider();
107 const expandMacroContentProvider = new ExpandMacroContentProvider(); 113 const expandMacroContentProvider = new ExpandMacroContentProvider();
108 114