Search in sources :

Example 11 with ExcludesConfiguration

use of com.intellij.openapi.compiler.options.ExcludesConfiguration in project intellij-community by JetBrains.

the class CompilerReferencesFindUsagesTest method doTestRunnableFindUsagesWithExcludesConfiguration.

private void doTestRunnableFindUsagesWithExcludesConfiguration(@NotNull Consumer<ExcludesConfiguration> excludesConfigurationPatcher, int expectedUsagesCount, String... testFiles) {
    final ExcludesConfiguration excludesConfiguration = CompilerConfiguration.getInstance(myProject).getExcludedEntriesConfiguration();
    try {
        configureByFiles(getName(), Arrays.stream(testFiles).map(f -> getName() + "/" + f).toArray(String[]::new));
        excludesConfigurationPatcher.consume(excludesConfiguration);
        assertSize(expectedUsagesCount, FunctionalExpressionSearch.search(myJavaFacade.findClass(CommonClassNames.JAVA_LANG_RUNNABLE)).findAll());
        myCompilerTester.rebuild();
        assertSize(expectedUsagesCount, FunctionalExpressionSearch.search(myJavaFacade.findClass(CommonClassNames.JAVA_LANG_RUNNABLE)).findAll());
    } finally {
        excludesConfiguration.removeAllExcludeEntryDescriptions();
    }
}
Also used : ExcludesConfiguration(com.intellij.openapi.compiler.options.ExcludesConfiguration)

Aggregations

ExcludesConfiguration (com.intellij.openapi.compiler.options.ExcludesConfiguration)11 ExcludeEntryDescription (com.intellij.openapi.compiler.options.ExcludeEntryDescription)6 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 Module (com.intellij.openapi.module.Module)4 Project (com.intellij.openapi.project.Project)4 ExcludedEntriesConfigurable (com.intellij.openapi.compiler.options.ExcludedEntriesConfigurable)2 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)2 ProjectFileIndex (com.intellij.openapi.roots.ProjectFileIndex)2 List (java.util.List)2 CompilerConfiguration (com.intellij.compiler.CompilerConfiguration)1 CompilerConfigurationImpl (com.intellij.compiler.CompilerConfigurationImpl)1 OpenFileDescriptor (com.intellij.openapi.fileEditor.OpenFileDescriptor)1 Navigatable (com.intellij.pom.Navigatable)1 PsiFile (com.intellij.psi.PsiFile)1 Processor (com.intellij.util.Processor)1 HashSet (com.intellij.util.containers.hash.HashSet)1 ArrayList (java.util.ArrayList)1 AndroidFacet (org.jetbrains.android.facet.AndroidFacet)1 AndroidPlatform (org.jetbrains.android.sdk.AndroidPlatform)1 NotNull (org.jetbrains.annotations.NotNull)1