Behavior on typing chars with code completion lookup is completely defined by our own handler + added tests for this handler + fixed a few bugs related to this behavior

This commit is contained in:
Valentin Kipyatkov
2014-11-13 17:47:04 +03:00
parent f36208718e
commit 3ebc681eec
52 changed files with 447 additions and 96 deletions
@@ -3,4 +3,4 @@ fun small(param: Int) {
fun test() = small(<caret>)
// EXIST: {"lookupString":"param =","tailText":" Int","itemText":"param ="}
// EXIST: {"lookupString":"param","tailText":" Int","itemText":"param ="}
@@ -3,5 +3,5 @@ fun small(first: Int, second: Int) {
fun test() = small(12, <caret>)
// ABSENT: "first ="
// EXIST: "second ="
// ABSENT: first
// EXIST: { lookupString:"second", itemText:"second =" }
@@ -7,5 +7,5 @@ fun small(paramFirst: ArrayList<String>, paramSecond: Comparable<java.lang.Runti
fun test() = small(<caret>)
// EXIST: {"lookupString":"paramSecond =","tailText":" Comparable<RuntimeException>","itemText":"paramSecond ="}
// EXIST: {"lookupString":"paramFirst =","tailText":" ArrayList<String>","itemText":"paramFirst ="}
// EXIST: {"lookupString":"paramSecond","tailText":" Comparable<RuntimeException>","itemText":"paramSecond ="}
// EXIST: {"lookupString":"paramFirst","tailText":" ArrayList<String>","itemText":"paramFirst ="}
@@ -6,6 +6,6 @@ fun small(paramFirst: Int, paramSecond: Int) {
fun test() = small(paramFirst = param<caret>)
// EXIST: paramTest
// ABSENT: {"lookupString":"paramFirst =","tailText":" Int","itemText":"paramFirst ="}
// ABSENT: "paramSecond ="
// ABSENT: {"lookupString":"paramFirst","tailText":" Int","itemText":"paramFirst ="}
// ABSENT: paramSecond
// NUMBER: 1
@@ -10,11 +10,11 @@ fun other() {
foo(n<caret>)
}
// EXIST: "nFirst ="
// EXIST: "nSecond ="
// EXIST: "nThird ="
// EXIST: { lookupString:"nFirst", itemText:"nFirst =" }
// EXIST: { lookupString:"nSecond", itemText:"nSecond =" }
// EXIST: { lookupString:"nThird", itemText:"nThird =" }
// EXIST: nLocal
// todo - should exist
// ABSENT: "nClassParam ="
// ABSENT: "nClassField ="
// ABSENT: nClassParam
// ABSENT: nClassField
@@ -6,5 +6,5 @@ fun other() {
Foo(p<caret>)
}
// EXIST: {"lookupString":"pFirst =","tailText":" String?","itemText":"pFirst ="}
// EXIST: {"lookupString":"pSecond =","tailText":" Int","itemText":"pSecond ="}
// EXIST: {"lookupString":"pFirst","tailText":" String?","itemText":"pFirst ="}
// EXIST: {"lookupString":"pSecond","tailText":" Int","itemText":"pSecond ="}
@@ -4,8 +4,8 @@ fun test() {
foo("str", paramThird = "test", param<caret>)
}
// ABSENT: "paramFirst ="
// EXIST: "paramSecond ="
// ABSENT: "paramThird ="
// EXIST: "paramFourth ="
// ABSENT: paramFirst
// EXIST: paramSecond
// ABSENT: paramThird
// EXIST: paramFourth
@@ -5,7 +5,7 @@ fun test() {
foo(12, param<caret>)
}
// ABSENT: "paramFirst ="
// EXIST: {"lookupString":"paramSecond =","tailText":" Int","itemText":"paramSecond ="}
// ABSENT: "paramThird ="
// ABSENT: "paramFourth ="
// ABSENT: paramFirst
// EXIST: {"lookupString":"paramSecond","tailText":" Int","itemText":"paramSecond ="}
// ABSENT: paramThird
// ABSENT: paramFourth
@@ -4,6 +4,6 @@ fun foo(first: Int, second: Int, third: String) {
fun test(p: Int) = foo(12, <caret>, third = "")
// EXIST: p
// ABSENT: "first ="
// EXIST: "third ="
// EXIST: "second ="
// ABSENT: first
// EXIST: third
// EXIST: second
@@ -4,6 +4,6 @@ fun foo(first: Int, second: Int, third: String) {
fun test(p: Int) = foo(<caret>second = 3)
// EXIST: p
// EXIST: "first ="
// EXIST: "second ="
// EXIST: "third ="
// EXIST: first
// EXIST: second
// EXIST: third
@@ -4,7 +4,7 @@ fun foo(first: Int, second: Int, third: String) {
fun test(p: Int) = foo(12, third = "", <caret>)
// ABSENT: p
// ABSENT: "first ="
// ABSENT: "third ="
// EXIST: "second ="
// ABSENT: first
// ABSENT: third
// EXIST: second
// NUMBER: 1
@@ -5,8 +5,8 @@ fun small(paramFirst: Int, paramSecond: Int) {
fun test() = small(param<caret>First = 12)
// EXIST: "paramFirst ="
// EXIST: "paramSecond ="
// EXIST: paramFirst
// EXIST: paramSecond
// EXIST: paramTest
// NUMBER: 3
@@ -2,5 +2,5 @@ import lib.KotlinClass
fun test() = KotlinClass().foo(<caret>)
// ABSENT: "p0 ="
// EXIST: "paramName ="
// ABSENT: p0
// EXIST: { lookupString:"paramName", itemText:"paramName =" }