- Processor<PsiElement> localProcessor = localProcessor(processor, progress, options.contains(Options.PROCESS_INJECTED_PSI), searcher);
+ ReadActionProcessor<PsiElement> localProcessor = new ReadActionProcessor<PsiElement>() {
+ @Override
+ public boolean processInReadAction(PsiElement scopeElement) {
+ if (!scopeElement.isValid()) return true;
+ if (!scopeElement.isPhysical()) {
+ scopeElement = scopeElement.getNavigationElement();
+ }
+ 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 LowLevelSearchUtil.processElementsContainingWordInElement(processor, scopeElement, searcher, processInjectedPsi, progress);
+ }
+
+ @Override
+ public String toString() {
+ return processor.toString();
+ }
+ };