KT-9738 Code completion of "emptyList()" after elvis operator inserts explicit type arguments

#KT-9738 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-02-09 22:27:13 +03:00
parent 8da01e7952
commit c9bb020d6e
6 changed files with 50 additions and 12 deletions
@@ -0,0 +1,5 @@
fun foo(list: List<String>, b: Boolean) {
val v = if (b) list else emp<caret>
}
// ELEMENT: emptyList
@@ -0,0 +1,5 @@
fun foo(list: List<String>, b: Boolean) {
val v = if (b) list else emptyList()<caret>
}
// ELEMENT: emptyList
@@ -0,0 +1,5 @@
fun foo(list: List<String>?) {
val v = list ?: emp<caret>
}
// ELEMENT: emptyList
@@ -0,0 +1,5 @@
fun foo(list: List<String>?) {
val v = list ?: emptyList()<caret>
}
// ELEMENT: emptyList
@@ -687,6 +687,18 @@ public class BasicCompletionHandlerTestGenerated extends AbstractBasicCompletion
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeArgsForCall extends AbstractBasicCompletionHandlerTest {
@TestMetadata("AfterElse.kt")
public void testAfterElse() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/typeArgsForCall/AfterElse.kt");
doTest(fileName);
}
@TestMetadata("AfterElvis.kt")
public void testAfterElvis() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/handlers/basic/typeArgsForCall/AfterElvis.kt");
doTest(fileName);
}
public void testAllFilesPresentInTypeArgsForCall() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/handlers/basic/typeArgsForCall"), Pattern.compile("^(.+)\\.kt$"), true);
}