From 5937e75ada9ae095cfac7cee96f02393247652a5 Mon Sep 17 00:00:00 2001 From: Max Medvedev Date: Thu, 4 Sep 2025 16:19:11 +0200 Subject: [PATCH] IJPL-199180 don't cancel lookup by actionTracker if the popup is shown already GitOrigin-RevId: 2ad5df41b5a01bac56b07680fd2a51777f1e5c0c --- .../com/intellij/codeInsight/completion/CompletionPhase.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt index 98d4e44bc37d..2424d8b07184 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhase.kt @@ -278,8 +278,9 @@ sealed class CompletionPhase @ApiStatus.Internal constructor( return } - if (phase.myTracker.hasAnythingHappened()) { - // activity has happened in the editor. We must cancel all the requests altogether + if (phase.myTracker.hasAnythingHappened() && (phase.indicator == null || !phase.indicator.lookup.isShown)) { + // activity has happened in the editor. We must cancel all the requests altogether. + // but we want to do this only if lookup is not shown yet. because if it's shown, the lookup is going to handle close by itself. LOG.trace { "Setting NoCompletion phase :: completionEditor=$completionEditor, expirationReason=${phase.myTracker.describeChangeEvent()}" } phase.cancelPhase() CompletionServiceImpl.setCompletionPhase(NoCompletion)