Skip to content

Commit

Permalink
fix: inlay hints config desyncronization between the frontend and the…
Browse files Browse the repository at this point in the history
… backend

See the explanation in the issue comment:
#3924 (comment)
  • Loading branch information
Veetaha committed Apr 11, 2020
1 parent 372414d commit 8c58c38
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions editors/code/src/inlay_hints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ 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 &&
!ctx.config.inlayHints.chainingHints
) {
return this.dispose();
}
await sleep(10);
if (this.updater) {
this.updater.syncCacheAndRenderHints();
} else {
Expand Down

0 comments on commit 8c58c38

Please sign in to comment.