SearchScope (@NotNull PsiMember member) { Project project = member.getProject(); SearchScope useScope = PsiSearchHelper.getInstance(project).getUseScope(member); // some classes may have references from within XML outside dependent modules, e.g. our actions if (useScope instanceof GlobalSearchScope globalUseScope && member instanceof PsiClass) { GlobalSearchScope projectScope = GlobalSearchScope.projectScope(project); GlobalSearchScope xmlFilesScope = GlobalSearchScope.getScopeRestrictedByFileTypes(projectScope, XmlFileType.INSTANCE); useScope = globalUseScope.uniteWith(xmlFilesScope); } return useScope; }