mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-119416 Smart type completion proposes nothing in String concatenation expressions
This commit is contained in:
@@ -666,7 +666,7 @@ public class ExpectedTypesProvider {
|
||||
}
|
||||
else if (i == JavaTokenType.PLUS) {
|
||||
if (anotherType == null || anotherType.equalsToText(CommonClassNames.JAVA_LANG_STRING)) {
|
||||
myResult = ExpectedTypeInfo.EMPTY_ARRAY;
|
||||
myResult = new ExpectedTypeInfo[]{createInfoImpl(PsiType.getJavaLangObject(expr.getManager(), expr.getResolveScope()), ExpectedTypeInfo.TYPE_OR_SUBTYPE, anotherType, TailType.NONE)};
|
||||
}
|
||||
else if (PsiType.DOUBLE.isAssignableFrom(anotherType)) {
|
||||
myResult = new ExpectedTypeInfo[]{createInfoImpl(PsiType.DOUBLE, ExpectedTypeInfo.TYPE_OR_SUBTYPE, anotherType, TailType.NONE)};
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public class Test {
|
||||
|
||||
{
|
||||
int abcdef = 2;
|
||||
System.out.println("" + abcdef<caret>);
|
||||
}
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
public class Test {
|
||||
|
||||
{
|
||||
int abcdef = 2;
|
||||
System.out.println("" + abc<caret>);
|
||||
}
|
||||
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Foo {
|
||||
|
||||
{
|
||||
System.out.println("" + <caret>);
|
||||
}
|
||||
}
|
||||
+4
@@ -321,6 +321,10 @@ public class SmartTypeCompletionOrderingTest extends CompletionSortingTestCase {
|
||||
checkPreferredItems 0, 'type', 'Object.class'
|
||||
}
|
||||
|
||||
public void testPreferStringsInStringConcatenation() {
|
||||
checkPreferredItems 0, 'toString'
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getBasePath() {
|
||||
return JavaTestUtil.getRelativeJavaTestDataPath() + BASE_PATH;
|
||||
|
||||
+1
@@ -1020,6 +1020,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
public void testArrayInitializerBeforeVarargs() throws Throwable { doTest(); }
|
||||
public void testDuplicateMembersFromSuperClass() throws Throwable { doTest(); }
|
||||
public void testInnerAfterNew() throws Throwable { doTest(); }
|
||||
public void testEverythingInStringConcatenation() throws Throwable { doTest(); }
|
||||
|
||||
public void testMemberImportStatically() {
|
||||
configureByTestName();
|
||||
|
||||
Reference in New Issue
Block a user