boolean (@NotNull final ReferencesSearch.SearchParameters p, @NotNull final Processor<? super PsiReference> consumer) { SearchScope userScope = p.getScopeDeterminedByUser(); if (!scopeCanContainForms(userScope)) return true; final PsiElement refElement = p.getElementToSearch(); final PsiFile psiFile = ReadAction.compute(() -> { if (!refElement.isValid()) return null; return refElement.getContainingFile(); }); if (psiFile == null) return true; final VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile == null) return true; final GlobalSearchScope[] scope = new GlobalSearchScope[1]; Project project = ReadAction.compute(() -> { Project project1 = psiFile.getProject(); Module module = ProjectRootManager.getInstance(project1).getFileIndex().getModuleForFile(virtualFile); if (module != null) { scope[0] = GlobalSearchScope.moduleWithDependenciesScope(module); } return project1; }); if (scope[0] == null) { return true; } final LocalSearchScope filterScope = userScope instanceof LocalSearchScope ? (LocalSearchScope)userScope : null; PsiManager psiManager = PsiManager.getInstance(project); if (refElement instanceof PsiPackage) { //no need to do anything //if (!UIFormUtil.processReferencesInUIForms(consumer, (PsiPackage)refElement, scope)) return false; } else if (refElement instanceof PsiClass) { if (!processReferencesInUIForms(consumer, psiManager,(PsiClass)refElement, scope[0], filterScope)) return false; } else if (refElement instanceof PsiEnumConstant) { if (!processEnumReferencesInUIForms(consumer, psiManager, (PsiEnumConstant)refElement, scope[0], filterScope)) return false; } else if (refElement instanceof PsiField) { if (!processReferencesInUIForms(consumer, psiManager, (PsiField)refElement, scope[0], filterScope)) return false; } else if (refElement instanceof IProperty) { if (!processReferencesInUIForms(consumer, psiManager, (Property)refElement, scope[0], filterScope)) return false; } else if (refElement instanceof PropertiesFile) { if (!processReferencesInUIForms(consumer, psiManager, (PropertiesFile)refElement, scope[0], filterScope)) return false; } return true; }