diff --git a/java/java-tests/testSrc/com/intellij/java/navigation/ChooseByNameTest.java b/java/java-tests/testSrc/com/intellij/java/navigation/ChooseByNameTest.java index e56762b78b13..1d2dd5208e44 100644 --- a/java/java-tests/testSrc/com/intellij/java/navigation/ChooseByNameTest.java +++ b/java/java-tests/testSrc/com/intellij/java/navigation/ChooseByNameTest.java @@ -35,8 +35,8 @@ import java.util.*; @SuppressWarnings("NewClassNamingConvention") public class ChooseByNameTest extends LightJavaCodeInsightFixtureTestCase { - private static final RegistryValue disableFuzzySearchRegistryValue = Registry.get("search.everywhere.fuzzy.file.search.ab.experiment.disable"); - private static final boolean initialDisableFuzzySearchRegistryValue = disableFuzzySearchRegistryValue.asBoolean(); + private static final RegistryValue enabledFuzzySearchRegistryValue = Registry.get("search.everywhere.fuzzy.file.search.ab.experiment.enabled"); + private static final boolean initialEnabledFuzzySearchRegistryValue = enabledFuzzySearchRegistryValue.asBoolean(); private static final String abExperimentValue = System.getProperty("platform.experiment.ab.manual.option", ""); private static final String fuzzyFileSearchExperimentOptionId = FuzzyFileSearchExperimentOption.FUZZY_FILE_SEARCH_EXPERIMENT_OPTION_ID; @@ -237,11 +237,11 @@ public class ChooseByNameTest extends LightJavaCodeInsightFixtureTestCase { assertTrue((objects.get(0)).getVirtualFile().getPath().contains("mockJDK")); // Fuzzy search finds some results for the query `mockJDK/Object.java`, so let's ensure the test runs with fuzzy search disabled. - disableFuzzySearchRegistryValue.setValue(true); + enabledFuzzySearchRegistryValue.setValue(false); assertEmpty(gotoFile("mockJDK/Object.java", true)); - disableFuzzySearchRegistryValue.setValue(initialDisableFuzzySearchRegistryValue); + enabledFuzzySearchRegistryValue.setValue(initialEnabledFuzzySearchRegistryValue); } public void test_goto_file_can_go_to_dir() { @@ -253,7 +253,7 @@ public class ChooseByNameTest extends LightJavaCodeInsightFixtureTestCase { PsiDirectory fooDir = fooIndex.getContainingDirectory(); PsiDirectory barDir = barIndex.getContainingDirectory(); - disableFuzzySearchRegistryValue.setValue(true); + enabledFuzzySearchRegistryValue.setValue(false); assertOrderedEquals(calcContributorElements(contributor, "foo/"), List.of(fooDir)); assertOrderedEquals(calcContributorElements(contributor, "foo\\"), List.of(fooDir)); @@ -271,7 +271,7 @@ public class ChooseByNameTest extends LightJavaCodeInsightFixtureTestCase { assertOrderedEquals(calcContributorElements(contributor, "bar.txt"), List.of(barIndex, barDir)); assertOrderedEquals(calcContributorElements(contributor, "bar"), List.of(barIndex, barDir)); - disableFuzzySearchRegistryValue.setValue(initialDisableFuzzySearchRegistryValue); + enabledFuzzySearchRegistryValue.setValue(initialEnabledFuzzySearchRegistryValue); } public void test_goto_file_can_go_to_dir_with_fuzzy() { @@ -309,14 +309,14 @@ public class ChooseByNameTest extends LightJavaCodeInsightFixtureTestCase { PsiFile fooFile = addEmptyFile("dir/fooFile.txt"); PsiDirectory fooDir = addEmptyFile("foo/barFile.txt").getContainingDirectory(); - disableFuzzySearchRegistryValue.setValue(true); + enabledFuzzySearchRegistryValue.setValue(false); SearchEverywhereContributor contributor = createFileContributor(getProject(), getTestRootDisposable()); List popupElements = calcContributorElements(contributor, "foo"); assertOrderedEquals(popupElements, List.of(fooFile, fooDir)); - disableFuzzySearchRegistryValue.setValue(initialDisableFuzzySearchRegistryValue); + enabledFuzzySearchRegistryValue.setValue(initialEnabledFuzzySearchRegistryValue); } public void test_prefer_files_to_directories_even_if_longer_with_fuzzy() { diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/FuzzyFileSearchExperimentOption.kt b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/FuzzyFileSearchExperimentOption.kt index 77c7368ec295..8c17d464f596 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/FuzzyFileSearchExperimentOption.kt +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/FuzzyFileSearchExperimentOption.kt @@ -11,7 +11,7 @@ import org.jetbrains.annotations.ApiStatus @ApiStatus.Internal internal fun isFuzzyFileSearchEnabled(): Boolean { - return !`is`("search.everywhere.fuzzy.file.search.ab.experiment.disable", false) && + return `is`("search.everywhere.fuzzy.file.search.ab.experiment.enabled", false) && ABExperiment.getABExperimentInstance().isExperimentOptionEnabled(FuzzyFileSearchExperimentOption::class.java) } diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index f33aba368636..b4bce865b3f2 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -1614,8 +1614,8 @@ search.everywhere.fuzzy.file.search.enabled.description=Enable fuzzy file search search.everywhere.fuzzy.class.search.enabled=false search.everywhere.fuzzy.class.search.enabled.description=Enable fuzzy class search -search.everywhere.fuzzy.file.search.ab.experiment.disable=false -search.everywhere.fuzzy.file.search.ab.experiment.disable.description=Disable fuzzy file search if in an experiment group +search.everywhere.fuzzy.file.search.ab.experiment.enabled=true +search.everywhere.fuzzy.file.search.ab.experiment.enabled.description=Enable fuzzy file search if in an experiment group custom.folding.max.lookup.depth=50 custom.folding.max.lookup.depth.description=Max lookup depth for custom folding comments in a PSI tree.