aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/extension.ts
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2019-11-17 18:47:50 +0000
committerEdwin Cheng <[email protected]>2019-11-19 13:49:06 +0000
commit3ccd05fedc46796f793295901a8619492256468e (patch)
tree018f46fca85c4d2e0ef4b73fa3971166e65de3e2 /editors/code/src/extension.ts
parentd2782ab1c1ec0b9f2ac2131859a9ee880f97bc12 (diff)
Add recursive expand in vscode
Diffstat (limited to 'editors/code/src/extension.ts')
-rw-r--r--editors/code/src/extension.ts20
1 files changed, 15 insertions, 5 deletions
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';
3 3
4import * as commands from './commands'; 4import * as commands from './commands';
5import { CargoWatchProvider } from './commands/cargo_watch'; 5import { CargoWatchProvider } from './commands/cargo_watch';
6import { ExpandMacroHoverProvider } from './commands/expand_macro'
6import { HintsUpdater } from './commands/inlay_hints'; 7import { HintsUpdater } from './commands/inlay_hints';
7import { 8import {
8 interactivelyStartCargoWatch, 9 interactivelyStartCargoWatch,
@@ -91,11 +92,11 @@ export function activate(context: vscode.ExtensionContext) {
91 const allNotifications: Iterable< 92 const allNotifications: Iterable<
92 [string, lc.GenericNotificationHandler] 93 [string, lc.GenericNotificationHandler]
93 > = [ 94 > = [
94 [ 95 [
95 'rust-analyzer/publishDecorations', 96 'rust-analyzer/publishDecorations',
96 notifications.publishDecorations.handle 97 notifications.publishDecorations.handle
97 ] 98 ]
98 ]; 99 ];
99 const syntaxTreeContentProvider = new SyntaxTreeContentProvider(); 100 const syntaxTreeContentProvider = new SyntaxTreeContentProvider();
100 101
101 // The events below are plain old javascript events, triggered and handled by vscode 102 // The events below are plain old javascript events, triggered and handled by vscode
@@ -121,6 +122,15 @@ export function activate(context: vscode.ExtensionContext) {
121 context.subscriptions 122 context.subscriptions
122 ); 123 );
123 124
125 const expandMacroContentProvider = new ExpandMacroHoverProvider();
126
127 disposeOnDeactivation(
128 vscode.languages.registerHoverProvider(
129 'rust',
130 expandMacroContentProvider
131 )
132 );
133
124 const startServer = () => Server.start(allNotifications); 134 const startServer = () => Server.start(allNotifications);
125 const reloadCommand = () => reloadServer(startServer); 135 const reloadCommand = () => reloadServer(startServer);
126 136