mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
create from usage: reuse 'completion inference' when create from argument list
This commit is contained in:
+1
-1
@@ -578,7 +578,7 @@ public class CreateFromUsageUtils {
|
||||
PsiElement parent = expr.getParent();
|
||||
|
||||
if (!(parent instanceof PsiReferenceExpression)) {
|
||||
ExpectedTypeInfo[] someExpectedTypes = ExpectedTypesProvider.getExpectedTypes(expr, false);
|
||||
ExpectedTypeInfo[] someExpectedTypes = ExpectedTypesProvider.getExpectedTypes(expr, PsiUtil.skipParenthesizedExprUp(parent) instanceof PsiExpressionList);
|
||||
if (someExpectedTypes.length > 0) {
|
||||
Arrays.sort(someExpectedTypes, new Comparator<ExpectedTypeInfo>() {
|
||||
@Override
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// "Create Local Variable 'foo'" "true"
|
||||
import java.util.*;
|
||||
class Test {
|
||||
{
|
||||
String foo<caret>;
|
||||
new Bar(Collections.singletonList(foo));
|
||||
}
|
||||
|
||||
class Bar {
|
||||
Bar(List<String> l) {
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Create Local Variable 'foo'" "true"
|
||||
import java.util.*;
|
||||
class Test {
|
||||
{
|
||||
new Bar(Collections.singletonList(fo<caret>o));
|
||||
}
|
||||
|
||||
class Bar {
|
||||
Bar(List<String> l) {
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user