diff options
Diffstat (limited to 'editors/code/src/extension.ts')
-rw-r--r-- | editors/code/src/extension.ts | 20 |
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 | ||
4 | import * as commands from './commands'; | 4 | import * as commands from './commands'; |
5 | import { CargoWatchProvider } from './commands/cargo_watch'; | 5 | import { CargoWatchProvider } from './commands/cargo_watch'; |
6 | import { ExpandMacroHoverProvider } from './commands/expand_macro' | ||
6 | import { HintsUpdater } from './commands/inlay_hints'; | 7 | import { HintsUpdater } from './commands/inlay_hints'; |
7 | import { | 8 | import { |
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 | ||