diff --git a/platform/lang-api/api-dump-unreviewed.txt b/platform/lang-api/api-dump-unreviewed.txt index 627833e2ca6d..8f98dc0d2274 100644 --- a/platform/lang-api/api-dump-unreviewed.txt +++ b/platform/lang-api/api-dump-unreviewed.txt @@ -2041,8 +2041,8 @@ c:com.intellij.ide.actions.searcheverywhere.ContributorSearchResult$Builder - setHasMore(Z):V com.intellij.ide.actions.searcheverywhere.EssentialContributor - s:checkEssential(com.intellij.ide.actions.searcheverywhere.SearchEverywhereContributor):Z -- s:checkEssentialWithoutMl(com.intellij.ide.actions.searcheverywhere.SearchEverywhereContributor):Z -- isEssential():Z +- s:checkEssentialByDefault(com.intellij.ide.actions.searcheverywhere.SearchEverywhereContributor):Z +- isEssentialByDefault():Z c:com.intellij.ide.actions.searcheverywhere.ExtendedInfo - ():V - (kotlin.jvm.functions.Function1,kotlin.jvm.functions.Function1):V diff --git a/platform/lang-api/src/com/intellij/ide/actions/searcheverywhere/EssentialContributor.java b/platform/lang-api/src/com/intellij/ide/actions/searcheverywhere/EssentialContributor.java index 1951c0e87799..f90896e6f732 100644 --- a/platform/lang-api/src/com/intellij/ide/actions/searcheverywhere/EssentialContributor.java +++ b/platform/lang-api/src/com/intellij/ide/actions/searcheverywhere/EssentialContributor.java @@ -11,12 +11,12 @@ import org.jetbrains.annotations.Nullable; */ public interface EssentialContributor { - default boolean isEssential() { + default boolean isEssentialByDefault() { return true; } - static boolean checkEssentialWithoutMl(SearchEverywhereContributor contributor) { - return (contributor instanceof EssentialContributor ic) && ic.isEssential(); + static boolean checkEssentialByDefault(SearchEverywhereContributor contributor) { + return (contributor instanceof EssentialContributor ic) && ic.isEssentialByDefault(); } static boolean checkEssential(SearchEverywhereContributor contributor) { @@ -25,7 +25,7 @@ public interface EssentialContributor { return isEssentialByMl; } else { - return checkEssentialWithoutMl(contributor); + return checkEssentialByDefault(contributor); } } /** diff --git a/platform/lang-impl/api-dump-unreviewed.txt b/platform/lang-impl/api-dump-unreviewed.txt index b2359ae57133..cb52b73de644 100644 --- a/platform/lang-impl/api-dump-unreviewed.txt +++ b/platform/lang-impl/api-dump-unreviewed.txt @@ -8363,7 +8363,7 @@ f:com.intellij.ide.actions.searcheverywhere.PSIPresentationBgRendererWrapper - getSupportedScopes():java.util.List - isDumbAware():Z - isEmptyPatternSupported():Z -- isEssential():Z +- isEssentialByDefault():Z - isMultiSelectionSupported():Z - isShownInSeparateTab():Z - isSlow():Z diff --git a/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/PSIPresentationBgRendererWrapper.java b/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/PSIPresentationBgRendererWrapper.java index 80a7eb66ce24..18d15703bdec 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/PSIPresentationBgRendererWrapper.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/PSIPresentationBgRendererWrapper.java @@ -61,8 +61,8 @@ public final class PSIPresentationBgRendererWrapper implements WeightedSearchEve } @Override - public boolean isEssential() { - return EssentialContributor.checkEssentialWithoutMl(myDelegate); + public boolean isEssentialByDefault() { + return EssentialContributor.checkEssentialByDefault(myDelegate); } @Override diff --git a/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/WaitForContributorsListenerWrapper.java b/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/WaitForContributorsListenerWrapper.java index 889f503f21e1..82f054b1f420 100644 --- a/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/WaitForContributorsListenerWrapper.java +++ b/platform/lang-impl/src/com/intellij/ide/actions/searcheverywhere/WaitForContributorsListenerWrapper.java @@ -50,7 +50,7 @@ public final class WaitForContributorsListenerWrapper implements SearchListener, private void initializeDefaultEssentialContributors(Collection> contributors) { if (defaultEssentialContributorsCache.isEmpty()) { Map, Boolean> fallbackContributors = contributors.stream() - .filter(EssentialContributor::checkEssentialWithoutMl) + .filter(EssentialContributor::checkEssentialByDefault) .collect(Collectors.toMap(Function.identity(), c -> false)); defaultEssentialContributorsCache.putAll(fallbackContributors); } diff --git a/platform/lang-impl/testSources/com/intellij/ide/actions/searcheverywhere/SETestUtil.kt b/platform/lang-impl/testSources/com/intellij/ide/actions/searcheverywhere/SETestUtil.kt index fd7e0688838c..3b6d00686d29 100644 --- a/platform/lang-impl/testSources/com/intellij/ide/actions/searcheverywhere/SETestUtil.kt +++ b/platform/lang-impl/testSources/com/intellij/ide/actions/searcheverywhere/SETestUtil.kt @@ -6,7 +6,7 @@ import com.intellij.util.Processor import javax.swing.JPanel import javax.swing.ListCellRenderer -fun createDumbContributor(id: String, showTab: Boolean = false, essential: Boolean = false): SearchEverywhereContributor = +fun createDumbContributor(id: String, showTab: Boolean = false, essentialByDefault: Boolean = false): SearchEverywhereContributor = object : SearchEverywhereContributor, EssentialContributor { override fun getSearchProviderId(): String = id override fun getGroupName(): String = id @@ -17,7 +17,7 @@ fun createDumbContributor(id: String, showTab: Boolean = false, essential: Boole override fun processSelectedItem(selected: Unit, modifiers: Int, searchText: String): Boolean = false override fun fetchElements(pattern: String, progressIndicator: ProgressIndicator, consumer: Processor) {} - override fun isEssential(): Boolean = essential + override fun isEssentialByDefault(): Boolean = essentialByDefault override fun toString(): String = id } \ No newline at end of file