boolean (PsiElement context) { if (context.getParent() != null && context.getParent() instanceof GrReferenceExpression && context.getParent().getParent() != null && context.getParent().getParent() instanceof GrCommandArgumentList) { return true; } if (GroovyCompletionUtil.nearestLeftSibling(context) instanceof PsiErrorElement && GroovyCompletionUtil.endsWithExpression(GroovyCompletionUtil.nearestLeftSibling(context).getPrevSibling())) { return true; } if (context.getParent() instanceof GrReferenceExpression && GroovyCompletionUtil.nearestLeftLeaf(context) instanceof PsiErrorElement && GroovyCompletionUtil.endsWithExpression(GroovyCompletionUtil.nearestLeftLeaf(context).getPrevSibling())) { return true; } if (context.getParent() instanceof PsiErrorElement && GroovyCompletionUtil.endsWithExpression(GroovyCompletionUtil.nearestLeftSibling(context.getParent()))) { return true; } return false; }