Skip to content

Commit

Permalink
Merge #3948
Browse files Browse the repository at this point in the history
3948: fix: inlay hints config desyncronization between the frontend and the backend r=matklad a=Veetaha

See the explanation in the issue comment:
#3924 (comment)

Workaround-ly fixes: #3924

Co-authored-by: veetaha <veetaha2@gmail.com>
  • Loading branch information
bors[bot] and Veetaha committed Apr 16, 2020
2 parents f1a07db + 7534266 commit aa887d7
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(100);
if (this.updater) {
this.updater.syncCacheAndRenderHints();
} else {
Expand Down

0 comments on commit aa887d7

Please sign in to comment.