boolean (PsiElement context, boolean acceptAnnotationMethods, boolean skipNLs) { PsiElement candidate; if (GroovyCompletionUtil.isInTypeDefinitionBody(context)) { PsiElement run = context; while(!(run.getParent() instanceof GrTypeDefinitionBody)) { run = run.getParent(); assert run != null; } candidate = PsiUtil.skipWhitespacesAndComments(run.getPrevSibling(), false, skipNLs); } else { candidate = PsiUtil.skipWhitespacesAndComments(PsiTreeUtil.prevLeaf(context), false); } if (candidate instanceof PsiErrorElement) candidate = candidate.getPrevSibling(); return candidate instanceof GrMethod && ((GrMethod)candidate).getBlock() == null && (acceptAnnotationMethods || !(candidate instanceof GrAnnotationMethod)); }