List<TextRange> (@NotNull PsiElement e, @NotNull CharSequence editorText, int cursorOffset, @NotNull Editor editor) { if (!(e instanceof GrIfStatement ifSt)) return null; GrStatement branch = ifSt.getElseBranch(); PsiElement elseKeyword = ifSt.getElseKeyword(); if (branch == null || elseKeyword == null) return null; return expandToWholeLine(editorText, new TextRange(elseKeyword.getTextRange().getStartOffset(), branch.getTextRange().getEndOffset())); }