diff options
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index d92cd164f..b8e3396a6 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -2,7 +2,6 @@ import * as vscode from 'vscode'; | |||
2 | import * as lc from 'vscode-languageclient'; | 2 | import * as lc from 'vscode-languageclient'; |
3 | 3 | ||
4 | import * as commands from './commands'; | 4 | import * as commands from './commands'; |
5 | import { ExpandMacroContentProvider } from './commands/expand_macro'; | ||
6 | import { HintsUpdater } from './commands/inlay_hints'; | 5 | import { HintsUpdater } from './commands/inlay_hints'; |
7 | import { StatusDisplay } from './commands/watch_status'; | 6 | import { StatusDisplay } from './commands/watch_status'; |
8 | import * as events from './events'; | 7 | import * as events from './events'; |
@@ -20,6 +19,7 @@ export async function activate(context: vscode.ExtensionContext) { | |||
20 | ctx.registerCommand('joinLines', commands.joinLines); | 19 | ctx.registerCommand('joinLines', commands.joinLines); |
21 | ctx.registerCommand('parentModule', commands.parentModule); | 20 | ctx.registerCommand('parentModule', commands.parentModule); |
22 | ctx.registerCommand('syntaxTree', commands.syntaxTree); | 21 | ctx.registerCommand('syntaxTree', commands.syntaxTree); |
22 | ctx.registerCommand('expandMacro', commands.expandMacro); | ||
23 | 23 | ||
24 | function disposeOnDeactivation(disposable: vscode.Disposable) { | 24 | function disposeOnDeactivation(disposable: vscode.Disposable) { |
25 | context.subscriptions.push(disposable); | 25 | context.subscriptions.push(disposable); |
@@ -65,25 +65,12 @@ export async function activate(context: vscode.ExtensionContext) { | |||
65 | params => watchStatus.handleProgressNotification(params), | 65 | params => watchStatus.handleProgressNotification(params), |
66 | ], | 66 | ], |
67 | ]; | 67 | ]; |
68 | const expandMacroContentProvider = new ExpandMacroContentProvider(); | ||
69 | 68 | ||
70 | // The events below are plain old javascript events, triggered and handled by vscode | 69 | // The events below are plain old javascript events, triggered and handled by vscode |
71 | vscode.window.onDidChangeActiveTextEditor( | 70 | vscode.window.onDidChangeActiveTextEditor( |
72 | events.changeActiveTextEditor.makeHandler(), | 71 | events.changeActiveTextEditor.makeHandler(), |
73 | ); | 72 | ); |
74 | 73 | ||
75 | disposeOnDeactivation( | ||
76 | vscode.workspace.registerTextDocumentContentProvider( | ||
77 | 'rust-analyzer', | ||
78 | expandMacroContentProvider, | ||
79 | ), | ||
80 | ); | ||
81 | |||
82 | registerCommand( | ||
83 | 'rust-analyzer.expandMacro', | ||
84 | commands.expandMacro.createHandle(expandMacroContentProvider), | ||
85 | ); | ||
86 | |||
87 | const startServer = () => Server.start(allNotifications); | 74 | const startServer = () => Server.start(allNotifications); |
88 | const reloadCommand = () => reloadServer(startServer); | 75 | const reloadCommand = () => reloadServer(startServer); |
89 | 76 | ||