void (@NotNull PyTryExceptStatement node) { boolean haveStar = false; boolean haveNotStar = false; for (PyExceptPart exceptPart: node.getExceptParts()) { var star = PyPsiUtils.getFirstChildOfType(exceptPart, PyTokenTypes.MULT); if (star != null) { haveStar = true; } else { haveNotStar = true; } if (haveNotStar && haveStar) { var exceptKeyword = exceptPart.getFirstChild(); int startOffset = exceptKeyword.getTextOffset(); int endOffset = exceptKeyword.getTextRange().getEndOffset(); if (star != null) { endOffset = star.getTextRange().getEndOffset(); } var textRange = new TextRange(startOffset, endOffset); getHolder().newAnnotation(HighlightSeverity.ERROR, PyPsiBundle.message("ANN.try.except.can.not.have.except.and.star.except")) .range(textRange).create(); break; } } }