mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-191797 Fix bug when evaluation doesnt work in lambda code block
This commit is contained in:
+5
-2
@@ -127,8 +127,11 @@ public class ExtractLightMethodObjectHandler {
|
||||
// expand lambda to code block if needed
|
||||
PsiElement containingMethod = PsiTreeUtil.getParentOfType(originalAnchor, PsiMember.class, PsiLambdaExpression.class);
|
||||
if (containingMethod instanceof PsiLambdaExpression) {
|
||||
PsiCodeBlock newBody = RefactoringUtil.expandExpressionLambdaToCodeBlock((PsiLambdaExpression)containingMethod);
|
||||
originalAnchor = newBody.getStatements()[0];
|
||||
PsiLambdaExpression lambdaExpression = (PsiLambdaExpression)containingMethod;
|
||||
if (lambdaExpression.getBody() instanceof PsiExpression) {
|
||||
PsiCodeBlock newBody = RefactoringUtil.expandExpressionLambdaToCodeBlock(lambdaExpression);
|
||||
originalAnchor = newBody.getStatements()[0];
|
||||
}
|
||||
}
|
||||
|
||||
PsiElement anchor = RefactoringUtil.getParentStatement(originalAnchor, false);
|
||||
|
||||
Reference in New Issue
Block a user