diff options
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 32 |
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'; | |||
9 | import * as events from './events'; | 9 | import * as events from './events'; |
10 | import * as notifications from './notifications'; | 10 | import * as notifications from './notifications'; |
11 | import { Server } from './server'; | 11 | import { Server } from './server'; |
12 | import { Ctx } from './ctx' | ||
13 | |||
14 | let ctx!: Ctx; | ||
12 | 15 | ||
13 | export async function activate(context: vscode.ExtensionContext) { | 16 | export 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 | ||