List<TextRange> (@NotNull PsiElement e, @NotNull CharSequence editorText, int cursorOffset, @NotNull Editor editor) { PsiElement[] children = e.getChildren(); PsiElement first = null; PsiElement last = null; for (PsiElement child : children) { if (child instanceof XmlToken token) { if (token.getTokenType() == XmlTokenType.XML_TAG_END) { last = token; break; } if (token.getTokenType() == XmlTokenType.XML_ELEMENT_DECL_START || token.getTokenType() == XmlTokenType.XML_ATTLIST_DECL_START ) { first = token; } } } List<TextRange> result = new ArrayList<>(1); if (first != null && last != null) { final int offset = last.getTextRange().getEndOffset() + 1; result.addAll(ExtendWordSelectionHandlerBase.expandToWholeLine(editorText, new TextRange(first.getTextRange().getStartOffset(), Math.min(offset, editorText.length())), false)); } return result; }