boolean (GrExpression invoked) { if (!(invoked instanceof GrReferenceExpression)) return false; final GroovyResolveResult resolveResult = ((GrReferenceExpression)invoked).advancedResolve(); return resolveResult.isInvokedOnProperty() || resolveResult.getElement() instanceof PsiVariable; }