diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoTaskRunnerUtil.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoTaskRunnerUtil.java index 8edb647bc3da..3a253195ecde 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoTaskRunnerUtil.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoTaskRunnerUtil.java @@ -79,10 +79,13 @@ public final class ParameterInfoTaskRunnerUtil { nonBlockingReadAction.finishOnUiThread( ModalityState.defaultModalityState(), continuation -> { + CancellablePromise promise = cancellablePromiseRef.get(); + if (promise != null && promise.isSucceeded()) { Component owner = getFocusOwner(project); if (Objects.equals(focusOwner, owner) || owner instanceof ParameterInfoController.WrapperPanel) { continuationConsumer.accept(continuation); } + } }) .expireWith(editor instanceof EditorImpl ? ((EditorImpl) editor).getDisposable() : project) .submit(AppExecutorUtil.getAppExecutorService())