aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/extension.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/extension.ts')
-rw-r--r--editors/code/src/extension.ts24
1 files changed, 24 insertions, 0 deletions
diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts
index c8c3004a7..c6efc2e7e 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 { HintsUpdater } from './commands/inlay_hints';
6import { 7import {
7 interactivelyStartCargoWatch, 8 interactivelyStartCargoWatch,
8 startCargoWatch 9 startCargoWatch
@@ -147,6 +148,29 @@ export function activate(context: vscode.ExtensionContext) {
147 148
148 // Start the language server, finally! 149 // Start the language server, finally!
149 startServer(); 150 startServer();
151
152 if (Server.config.displayInlayHints) {
153 const hintsUpdater = new HintsUpdater();
154 hintsUpdater.loadHints(vscode.window.activeTextEditor).then(() => {
155 disposeOnDeactivation(
156 vscode.window.onDidChangeActiveTextEditor(editor =>
157 hintsUpdater.loadHints(editor)
158 )
159 );
160 disposeOnDeactivation(
161 vscode.workspace.onDidChangeTextDocument(e =>
162 hintsUpdater.updateHints(e)
163 )
164 );
165 disposeOnDeactivation(
166 vscode.workspace.onDidChangeConfiguration(_ =>
167 hintsUpdater.toggleHintsDisplay(
168 Server.config.displayInlayHints
169 )
170 )
171 );
172 });
173 }
150} 174}
151 175
152export function deactivate(): Thenable<void> { 176export function deactivate(): Thenable<void> {