List<TextRange> (@NotNull PsiElement e, @NotNull CharSequence editorText, int cursorOffset, @NotNull Editor editor) { ASTNode node = BasicJavaAstTreeUtil.toNode(e); if (node == null) { return null; } ASTNode methodExpression = BasicJavaAstTreeUtil.getMethodExpression(node); if (methodExpression == null) { return null; } ASTNode referenceNameElement = BasicJavaAstTreeUtil.getReferenceNameElement(methodExpression); if (referenceNameElement == null) { return null; } else { return Arrays.asList(new TextRange(referenceNameElement.getTextRange().getStartOffset(), e.getTextRange().getEndOffset()), e.getTextRange()); } }