From 3ccd05fedc46796f793295901a8619492256468e Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Mon, 18 Nov 2019 02:47:50 +0800 Subject: Add recursive expand in vscode --- editors/code/src/extension.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'editors/code/src/extension.ts') diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts index c06928d12..1dfa6046f 100644 --- a/editors/code/src/extension.ts +++ b/editors/code/src/extension.ts @@ -3,6 +3,7 @@ import * as lc from 'vscode-languageclient'; import * as commands from './commands'; import { CargoWatchProvider } from './commands/cargo_watch'; +import { ExpandMacroHoverProvider } from './commands/expand_macro' import { HintsUpdater } from './commands/inlay_hints'; import { interactivelyStartCargoWatch, @@ -91,11 +92,11 @@ export function activate(context: vscode.ExtensionContext) { const allNotifications: Iterable< [string, lc.GenericNotificationHandler] > = [ - [ - 'rust-analyzer/publishDecorations', - notifications.publishDecorations.handle - ] - ]; + [ + 'rust-analyzer/publishDecorations', + notifications.publishDecorations.handle + ] + ]; const syntaxTreeContentProvider = new SyntaxTreeContentProvider(); // The events below are plain old javascript events, triggered and handled by vscode @@ -121,6 +122,15 @@ export function activate(context: vscode.ExtensionContext) { context.subscriptions ); + const expandMacroContentProvider = new ExpandMacroHoverProvider(); + + disposeOnDeactivation( + vscode.languages.registerHoverProvider( + 'rust', + expandMacroContentProvider + ) + ); + const startServer = () => Server.start(allNotifications); const reloadCommand = () => reloadServer(startServer); -- cgit v1.2.3