aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-04-16 10:35:42 +0100
committerGitHub <[email protected]>2020-04-16 10:35:42 +0100
commitaa887d7ab463bae17ffca2aa7eaf1643ea27ab91 (patch)
treeff5db3acb7b222dbfc251ba1ebb4fc615afb1175 /editors/code/src
parentf1a07dbf5559e882f46e79ed2a299cf151b99498 (diff)
parent7534266156eb6e2deeac748eddc5f8c7af5f1239 (diff)
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 <[email protected]>
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 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 {