aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/main.ts
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-30 18:30:30 +0000
committerAleksey Kladov <[email protected]>2019-12-30 18:31:07 +0000
commit94be27fc44763afbf67d36010d4aa05639191e4b (patch)
tree7c1c6f94918bbb4343f0a2122c8989978ff5b9ac /editors/code/src/main.ts
parent68f47a5b10cfbb7b0168a0f24ddc7d8ced6cedda (diff)
Move expand macro to the new context
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r--editors/code/src/main.ts15
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';
2import * as lc from 'vscode-languageclient'; 2import * as lc from 'vscode-languageclient';
3 3
4import * as commands from './commands'; 4import * as commands from './commands';
5import { ExpandMacroContentProvider } from './commands/expand_macro';
6import { HintsUpdater } from './commands/inlay_hints'; 5import { HintsUpdater } from './commands/inlay_hints';
7import { StatusDisplay } from './commands/watch_status'; 6import { StatusDisplay } from './commands/watch_status';
8import * as events from './events'; 7import * 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