mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove CompletionPhaseListener
GitOrigin-RevId: 7879662b1c631cad154d9804ee715003efd96ee3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
4e36fac0a4
commit
b0aaa01ee8
-13
@@ -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<CompletionPhaseListener> TOPIC = new Topic<>("CompletionPhaseListener", CompletionPhaseListener.class);
|
||||
}
|
||||
+1
-12
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user