From b0aaa01ee8ab7bc17058c9bcea6154593dcd8edb Mon Sep 17 00:00:00 2001 From: peter Date: Thu, 26 Sep 2019 11:14:03 +0200 Subject: [PATCH] remove CompletionPhaseListener GitOrigin-RevId: 7879662b1c631cad154d9804ee715003efd96ee3 --- .../completion/CompletionPhaseListener.java | 13 ------------- .../completion/impl/CompletionServiceImpl.java | 13 +------------ 2 files changed, 1 insertion(+), 25 deletions(-) delete mode 100644 platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhaseListener.java diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhaseListener.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhaseListener.java deleted file mode 100644 index e171f9ce4f85..000000000000 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionPhaseListener.java +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -package com.intellij.codeInsight.completion; - -import com.intellij.util.messages.Topic; - -/** - * @author yole - */ -public interface CompletionPhaseListener { - void completionPhaseChanged(boolean isCompletionRunning); - - Topic TOPIC = new Topic<>("CompletionPhaseListener", CompletionPhaseListener.class); -} diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/CompletionServiceImpl.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/CompletionServiceImpl.java index a6eb4aaf47ad..0b4e0065a27f 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/CompletionServiceImpl.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/impl/CompletionServiceImpl.java @@ -238,23 +238,12 @@ public final class CompletionServiceImpl extends CompletionService { if (oldIndicator != null && !(phase instanceof CompletionPhase.BgCalculation)) { LOG.assertTrue(!oldIndicator.isRunning() || oldIndicator.isCanceled(), "don't change phase during running completion: oldPhase=" + oldPhase); } - boolean wasCompletionRunning = isRunningPhase(oldPhase); - boolean isCompletionRunning = isRunningPhase(phase); - if (isCompletionRunning != wasCompletionRunning) { - ApplicationManager.getApplication().getMessageBus().syncPublisher(CompletionPhaseListener.TOPIC).completionPhaseChanged(isCompletionRunning); - } Disposer.dispose(oldPhase); ourPhase = phase; ourPhaseTrace = new Throwable(); } - private static boolean isRunningPhase(@NotNull CompletionPhase phase) { - return phase != CompletionPhase.NoCompletion && !(phase instanceof CompletionPhase.ZombiePhase) && - !(phase instanceof CompletionPhase.ItemsCalculated); - } - - public static CompletionPhase getCompletionPhase() { return ourPhase; } @@ -281,7 +270,7 @@ public final class CompletionServiceImpl extends CompletionService { } else { sorter = sorter.weigh(new LookupElementWeigher(id, true, false) { @Override - public Comparable weigh(@NotNull LookupElement element) { + public Comparable weigh(@NotNull LookupElement element) { //noinspection unchecked return weigher.weigh(element, location); }