boolean (PsiElement context) { if (context != null && GroovyCompletionUtil.nearestLeftSibling(context) instanceof GrTryCatchStatement) { GrTryCatchStatement tryStatement = (GrTryCatchStatement) GroovyCompletionUtil.nearestLeftSibling(context); if (tryStatement == null) return false; if (tryStatement.getFinallyClause() == null) { return true; } } if (context != null && GroovyCompletionUtil.nearestLeftSibling(context) instanceof PsiErrorElement && GroovyCompletionUtil.nearestLeftSibling(context).getPrevSibling() instanceof GrTryCatchStatement) { GrTryCatchStatement tryStatement = (GrTryCatchStatement) GroovyCompletionUtil.nearestLeftSibling(context).getPrevSibling(); if (tryStatement == null) return false; if (tryStatement.getFinallyClause() == null) { return true; } } if (context != null && (context.getParent() instanceof GrReferenceExpression || context.getParent() instanceof PsiErrorElement) && GroovyCompletionUtil.nearestLeftSibling(context.getParent()) instanceof GrTryCatchStatement) { GrTryCatchStatement tryStatement = (GrTryCatchStatement) GroovyCompletionUtil.nearestLeftSibling(context.getParent()); if (tryStatement == null) return false; if (tryStatement.getFinallyClause() == null) { return true; } } if (context != null && (context.getParent() instanceof GrReferenceExpression || context.getParent() instanceof PsiErrorElement) && GroovyCompletionUtil.nearestLeftSibling(context.getParent()) instanceof PsiErrorElement && GroovyCompletionUtil.nearestLeftSibling(context.getParent()).getPrevSibling() instanceof GrTryCatchStatement) { GrTryCatchStatement tryStatement = (GrTryCatchStatement) GroovyCompletionUtil.nearestLeftSibling(context.getParent()).getPrevSibling(); if (tryStatement == null) return false; if (tryStatement.getFinallyClause() == null) { return true; } } if (context != null && (context.getParent() instanceof GrReferenceExpression) && (context.getParent().getParent() instanceof GrMethodCall) && GroovyCompletionUtil.nearestLeftSibling(context.getParent().getParent()) instanceof GrTryCatchStatement) { GrTryCatchStatement tryStatement = (GrTryCatchStatement) GroovyCompletionUtil.nearestLeftSibling(context.getParent().getParent()); if (tryStatement == null) return false; if (tryStatement.getFinallyClause() == null) { return true; } } return false; }