aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/code/src/inlay_hints.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts
index da74f03d2..a09531797 100644
--- a/editors/code/src/inlay_hints.ts
+++ b/editors/code/src/inlay_hints.ts
@@ -3,13 +3,13 @@ import * as vscode from 'vscode';
3import * as ra from './rust-analyzer-api'; 3import * as ra from './rust-analyzer-api';
4 4
5import { Ctx, Disposable } from './ctx'; 5import { Ctx, Disposable } from './ctx';
6import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor } from './util'; 6import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor, sleep } from './util';
7 7
8 8
9export function activateInlayHints(ctx: Ctx) { 9export function activateInlayHints(ctx: Ctx) {
10 const maybeUpdater = { 10 const maybeUpdater = {
11 updater: null as null | HintsUpdater, 11 updater: null as null | HintsUpdater,
12 onConfigChange() { 12 async onConfigChange() {
13 if ( 13 if (
14 !ctx.config.inlayHints.typeHints && 14 !ctx.config.inlayHints.typeHints &&
15 !ctx.config.inlayHints.parameterHints && 15 !ctx.config.inlayHints.parameterHints &&
@@ -17,6 +17,7 @@ export function activateInlayHints(ctx: Ctx) {
17 ) { 17 ) {
18 return this.dispose(); 18 return this.dispose();
19 } 19 }
20 await sleep(100);
20 if (this.updater) { 21 if (this.updater) {
21 this.updater.syncCacheAndRenderHints(); 22 this.updater.syncCacheAndRenderHints();
22 } else { 23 } else {