boolean (PsiElement scopeElement) { if (!scopeElement.isValid()) return true; if (!scopeElement.isPhysical() || scopeElement instanceof PsiCompiledElement) { scopeElement = scopeElement.getNavigationElement(); } if (scopeElement instanceof PsiCompiledElement) { // can't scan text of the element return true; } if (scopeElement.getTextRange() == null) { // clients can put whatever they want to the LocalSearchScope. Skip what we can't process. LOG.debug("Element " + scopeElement + " of class " + scopeElement.getClass() + " has null range"); return true; } return processor.execute(scopeElement, LowLevelSearchUtil.getTextOccurrencesInScope(scopeElement, searcher), searcher); }