mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
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 <veetaha2@gmail.com>
This commit is contained in:
commit
aa887d7ab4
1 changed files with 3 additions and 2 deletions
|
@ -3,13 +3,13 @@ import * as vscode from 'vscode';
|
||||||
import * as ra from './rust-analyzer-api';
|
import * as ra from './rust-analyzer-api';
|
||||||
|
|
||||||
import { Ctx, Disposable } from './ctx';
|
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) {
|
export function activateInlayHints(ctx: Ctx) {
|
||||||
const maybeUpdater = {
|
const maybeUpdater = {
|
||||||
updater: null as null | HintsUpdater,
|
updater: null as null | HintsUpdater,
|
||||||
onConfigChange() {
|
async onConfigChange() {
|
||||||
if (
|
if (
|
||||||
!ctx.config.inlayHints.typeHints &&
|
!ctx.config.inlayHints.typeHints &&
|
||||||
!ctx.config.inlayHints.parameterHints &&
|
!ctx.config.inlayHints.parameterHints &&
|
||||||
|
@ -17,6 +17,7 @@ export function activateInlayHints(ctx: Ctx) {
|
||||||
) {
|
) {
|
||||||
return this.dispose();
|
return this.dispose();
|
||||||
}
|
}
|
||||||
|
await sleep(100);
|
||||||
if (this.updater) {
|
if (this.updater) {
|
||||||
this.updater.syncCacheAndRenderHints();
|
this.updater.syncCacheAndRenderHints();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue