From 7534266156eb6e2deeac748eddc5f8c7af5f1239 Mon Sep 17 00:00:00 2001 From: veetaha Date: Sat, 11 Apr 2020 18:22:13 +0300 Subject: fix: inlay hints config desyncronization between the frontend and the backend See the explanation in the issue comment: https://github.com/rust-analyzer/rust-analyzer/issues/3924#issuecomment-612444566 --- editors/code/src/inlay_hints.ts | 5 +++-- 1 file 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'; 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 { -- cgit v1.2.3