mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Move expand macro to the new context
This commit is contained in:
parent
68f47a5b10
commit
94be27fc44
5 changed files with 53 additions and 75 deletions
|
@ -2,7 +2,6 @@ import * as vscode from 'vscode';
|
|||
import * as lc from 'vscode-languageclient';
|
||||
|
||||
import * as commands from './commands';
|
||||
import { ExpandMacroContentProvider } from './commands/expand_macro';
|
||||
import { HintsUpdater } from './commands/inlay_hints';
|
||||
import { StatusDisplay } from './commands/watch_status';
|
||||
import * as events from './events';
|
||||
|
@ -20,6 +19,7 @@ export async function activate(context: vscode.ExtensionContext) {
|
|||
ctx.registerCommand('joinLines', commands.joinLines);
|
||||
ctx.registerCommand('parentModule', commands.parentModule);
|
||||
ctx.registerCommand('syntaxTree', commands.syntaxTree);
|
||||
ctx.registerCommand('expandMacro', commands.expandMacro);
|
||||
|
||||
function disposeOnDeactivation(disposable: vscode.Disposable) {
|
||||
context.subscriptions.push(disposable);
|
||||
|
@ -65,25 +65,12 @@ export async function activate(context: vscode.ExtensionContext) {
|
|||
params => watchStatus.handleProgressNotification(params),
|
||||
],
|
||||
];
|
||||
const expandMacroContentProvider = new ExpandMacroContentProvider();
|
||||
|
||||
// The events below are plain old javascript events, triggered and handled by vscode
|
||||
vscode.window.onDidChangeActiveTextEditor(
|
||||
events.changeActiveTextEditor.makeHandler(),
|
||||
);
|
||||
|
||||
disposeOnDeactivation(
|
||||
vscode.workspace.registerTextDocumentContentProvider(
|
||||
'rust-analyzer',
|
||||
expandMacroContentProvider,
|
||||
),
|
||||
);
|
||||
|
||||
registerCommand(
|
||||
'rust-analyzer.expandMacro',
|
||||
commands.expandMacro.createHandle(expandMacroContentProvider),
|
||||
);
|
||||
|
||||
const startServer = () => Server.start(allNotifications);
|
||||
const reloadCommand = () => reloadServer(startServer);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue