void (PsiFile psiFile, final Set<? extends PsiFile> searchFor, final List<? super UsageInfo> result) { DependenciesBuilder.analyzeFileDependencies(psiFile, (place, dependency) -> { PsiFile dependencyFile = dependency.getContainingFile(); if (dependencyFile != null) { final PsiElement navigationElement = dependencyFile.getNavigationElement(); if (navigationElement instanceof PsiFile) { dependencyFile = (PsiFile)navigationElement; } } if (searchFor.contains(dependencyFile)) { result.add(new UsageInfo(place)); } }); }