GlobalSearchScope (Project project, GlobalSearchScope scope) { Set<VirtualFile> allAnnotationFiles = new HashSet<>(); for (PsiClass javaLangAnnotation : JavaPsiFacade.getInstance(project) .findClasses(CommonClassNames.JAVA_LANG_ANNOTATION_ANNOTATION, allScope(project))) { DirectClassInheritorsSearch.SearchParameters parameters = new DirectClassInheritorsSearch.SearchParameters(javaLangAnnotation, scope, false, true) { @Override public boolean shouldSearchInLanguage(@NotNull Language language) { return language != JavaLanguage.INSTANCE; } }; DirectClassInheritorsSearch.search(parameters).forEach(annotationClass -> { ProgressManager.checkCanceled(); ContainerUtil.addIfNotNull(allAnnotationFiles, PsiUtilCore.getVirtualFile(annotationClass)); return true; }); } return filesWithLibrariesScope(project, allAnnotationFiles); }