mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
create method from usage: treat polyadic expressions as for completion by containing expression (IDEA-151432)
This commit is contained in:
@@ -581,7 +581,7 @@ public class CreateFromUsageUtils {
|
||||
PsiExpressionList expressionList = ObjectUtils
|
||||
.tryCast(PsiUtil.skipParenthesizedExprUp(isAssignmentToFunctionalExpression ? parent.getParent() : parent),
|
||||
PsiExpressionList.class);
|
||||
boolean forCompletion = expressionList != null;
|
||||
boolean forCompletion = expressionList != null || parent.getParent() instanceof PsiPolyadicExpression;
|
||||
ExpectedTypeInfo[] someExpectedTypes = ExpectedTypesProvider.getExpectedTypes(expr, forCompletion);
|
||||
if (someExpectedTypes.length > 0) {
|
||||
Comparator<ExpectedTypeInfo> comparator = expectedTypesComparator;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Create method 'f'" "true"
|
||||
class Test {
|
||||
{
|
||||
long l = f(1) + f(2);
|
||||
}
|
||||
|
||||
private long f(int i) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Create method 'f'" "true"
|
||||
class Test {
|
||||
{
|
||||
long l = f(1) + <caret>f(2);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user