Skip to content

Commit 7534266

Browse files
committed
fix: inlay hints config desyncronization between the frontend and the backend
See the explanation in the issue comment: #3924 (comment)
1 parent 372414d commit 7534266

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

editors/code/src/inlay_hints.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@ import * as vscode from 'vscode';
33
import * as ra from './rust-analyzer-api';
44

55
import { Ctx, Disposable } from './ctx';
6-
import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor } from './util';
6+
import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor, sleep } from './util';
77

88

99
export function activateInlayHints(ctx: Ctx) {
1010
const maybeUpdater = {
1111
updater: null as null | HintsUpdater,
12-
onConfigChange() {
12+
async onConfigChange() {
1313
if (
1414
!ctx.config.inlayHints.typeHints &&
1515
!ctx.config.inlayHints.parameterHints &&
1616
!ctx.config.inlayHints.chainingHints
1717
) {
1818
return this.dispose();
1919
}
20+
await sleep(100);
2021
if (this.updater) {
2122
this.updater.syncCacheAndRenderHints();
2223
} else {

0 commit comments

Comments
 (0)