boolean (PsiElement element) { if (isAfterExpression(element) || JavaStringContextType.isStringLiteral(element)) { return false; } PsiElement statement = PsiTreeUtil.getParentOfType(element, PsiStatement.class, PsiLambdaExpression.class); if (statement instanceof PsiLambdaExpression) { PsiElement body = ((PsiLambdaExpression)statement).getBody(); if (PsiTreeUtil.isAncestor(body, element, false)) { statement = body; } } return statement != null && statement.getTextRange().getStartOffset() == element.getTextRange().getStartOffset(); }