void (final RegExpBackref backref) { final RegExpGroup group = backref.resolve(); if (group == null) { myHolder.newAnnotation(HighlightSeverity.ERROR, RegExpBundle.message("error.unresolved.back.reference")) .highlightType(ProblemHighlightType.LIKE_UNKNOWN_SYMBOL).create(); } else if (PsiTreeUtil.isAncestor(group, backref, true)) { myHolder.newAnnotation(HighlightSeverity.WARNING, RegExpBundle.message("error.back.reference.is.nested.into.the.capturing.group.it.refers.to")).create(); } }