Add recursive expand in vscode

This commit is contained in:
Edwin Cheng 2019-11-18 02:47:50 +08:00
parent d2782ab1c1
commit 3ccd05fedc
8 changed files with 210 additions and 5 deletions

View file

@ -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);