mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IJPL-55632 ABT-37 Rename registry key to disable ab experiment
GitOrigin-RevId: 77f15fd9b5627357c1c0b2d70b5366a25c07afb3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
420003c473
commit
4b99f2fbfb
@@ -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<Object> 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() {
|
||||
|
||||
+1
-1
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user