diff options
author | veetaha <[email protected]> | 2020-04-11 16:22:13 +0100 |
---|---|---|
committer | veetaha <[email protected]> | 2020-04-11 18:01:54 +0100 |
commit | 7534266156eb6e2deeac748eddc5f8c7af5f1239 (patch) | |
tree | 0e6bbd410eb07e744df1278c84f94d3cec5778c5 /editors/code/src | |
parent | 372414d27b41f60142f6c01fd48746a36e71f392 (diff) |
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
Diffstat (limited to 'editors/code/src')
-rw-r--r-- | editors/code/src/inlay_hints.ts | 5 |
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'; | |||
3 | import * as ra from './rust-analyzer-api'; | 3 | import * as ra from './rust-analyzer-api'; |
4 | 4 | ||
5 | import { Ctx, Disposable } from './ctx'; | 5 | import { Ctx, Disposable } from './ctx'; |
6 | import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor } from './util'; | 6 | import { sendRequestWithRetry, isRustDocument, RustDocument, RustEditor, sleep } from './util'; |
7 | 7 | ||
8 | 8 | ||
9 | export function activateInlayHints(ctx: Ctx) { | 9 | export 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 { |