List<TextRange> (@NotNull PsiElement e, @NotNull CharSequence editorText, int cursorOffset, @NotNull Editor editor) { List<TextRange> result = new ArrayList<>(); ASTNode node = BasicJavaAstTreeUtil.toNode(e); if (node == null) { return null; } result.add(getElementRange(node)); List<ASTNode> children = BasicJavaAstTreeUtil.getChildren(node); if (!children.isEmpty()) { int start = findOpeningBrace(children); // in non-Java PsiClasses, there can be no opening brace if (start != 0) { int end = findClosingBrace(children, start); result.addAll(expandToWholeLine(editorText, new TextRange(start, end))); } } return result; }