void (@NotNull PsiElement psiElement, @NotNull AnnotationHolder holder) { if (psiElement instanceof RegExpFile && psiElement.getCopyableUserData(KEY) == Boolean.TRUE) { final PsiElement pattern = psiElement.getFirstChild(); if (!(pattern instanceof RegExpPattern)) { return; } final RegExpBranch[] branches = ((RegExpPattern)pattern).getBranches(); if (branches.length == 1 && branches[0].getAtoms().length == 0) { return; } for (RegExpBranch branch : branches) { final int[] count = new int[1]; branch.accept(new RegExpRecursiveElementVisitor() { @Override public void visitRegExpGroup(RegExpGroup group) { if (group.isCapturing()) { count[0]++; } super.visitRegExpGroup(group); } }); if (count[0] != 1) { holder.newAnnotation(HighlightSeverity.WARNING, IntelliLangBundle.message("annotation.message.the.pattern")).range(branch) .create(); } } } }