GlobalSearchScope (@NotNull Project project, @NotNull ProjectFileIndex fileIndex, @NotNull GlobalSearchScope baseScope, @NotNull PsiElement element) { VirtualFile file = PsiUtilCore.getVirtualFile(element); if (file == null || !fileIndex.isInLibrary(file)) return baseScope; return baseScope.uniteWith(ProjectScope.getLibrariesScope(project)); }