LocalSearchScope (@NotNull LocalSearchScope scope1, @NotNull LocalSearchScope scope2) { List<PsiElement> result = new ArrayList<>(); for (PsiElement element1 : scope1.myScope) { for (PsiElement element2 : scope2.myScope) { PsiElement element = intersectScopeElements(element1, element2); if (element != null) { result.add(element); } } } return new LocalSearchScope(PsiUtilCore.toPsiElementArray(result), null, scope1.myIgnoreInjectedPsi || scope2.myIgnoreInjectedPsi); }