about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-16 09:35:42 +0000
committerGitHub <noreply@github.com>2020-04-16 09:35:42 +0000
commitaa887d7ab463bae17ffca2aa7eaf1643ea27ab91 (patch)
treeff5db3acb7b222dbfc251ba1ebb4fc615afb1175 /editors/code/src
parentf1a07dbf5559e882f46e79ed2a299cf151b99498 (diff)
parent7534266156eb6e2deeac748eddc5f8c7af5f1239 (diff)
downloadrust-aa887d7ab463bae17ffca2aa7eaf1643ea27ab91.tar.gz
rust-aa887d7ab463bae17ffca2aa7eaf1643ea27ab91.zip
Merge #3948
3948: fix: inlay hints config desyncronization between the frontend and the backend r=matklad a=Veetaha

See the explanation in the issue comment:
https://github.com/rust-analyzer/rust-analyzer/issues/3924#issuecomment-612444566

Workaround-ly fixes: #3924

Co-authored-by: veetaha <veetaha2@gmail.com>
Diffstat (limited to 'editors/code/src')
-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 da74f03d2d7..a0953179706 100644
--- a/editors/code/src/inlay_hints.ts
+++ b/editors/code/src/inlay_hints.ts
@@ -3,13 +3,13 @@ import * as vscode from 'vscode';
 import * as ra from './rust-analyzer-api';
 
 import { Ctx, Disposable } from './ctx';
-import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor } from './util';
+import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor, sleep } from './util';
 
 
 export function activateInlayHints(ctx: Ctx) {
     const maybeUpdater = {
         updater: null as null | HintsUpdater,
-        onConfigChange() {
+        async onConfigChange() {
             if (
                 !ctx.config.inlayHints.typeHints &&
                 !ctx.config.inlayHints.parameterHints &&
@@ -17,6 +17,7 @@ export function activateInlayHints(ctx: Ctx) {
             ) {
                 return this.dispose();
             }
+            await sleep(100);
             if (this.updater) {
                 this.updater.syncCacheAndRenderHints();
             } else {