PsiElement (CompletionParameters parameters) { PsiElement parent = parameters.getPosition().getParent(); if (parent instanceof GrReferenceExpression) { if (((GrReferenceExpression)parent).getQualifier() != null) return null; return parent.getParent(); } if (parent == null || parent.getParent() == null) { return null; } return parent.getParent().getParent(); }