Created module idea-test-framework and moved classes needed for idea tests there
Moved tests for completion and their test data into module idea-completion
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
val aaabbbccc = 1
|
||||
aaa<caret>bbbccc
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: aaabbbccc, aaabbcc
|
||||
@@ -0,0 +1,2 @@
|
||||
val aaabbcc = 1
|
||||
aaabb<caret>
|
||||
@@ -0,0 +1,7 @@
|
||||
class <caret>A(aaabbbccc: Int) {
|
||||
val aabbcc = 1
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: aabbcc
|
||||
// ABSENT: aaabbbccc
|
||||
@@ -0,0 +1 @@
|
||||
aa<caret>
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
val aaabbbccc = 1
|
||||
aaa<caret>bbbccc
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: aaabbbccc
|
||||
@@ -0,0 +1 @@
|
||||
aaabb<caret>
|
||||
@@ -0,0 +1,9 @@
|
||||
fun foo() {
|
||||
val aaa1 = 1
|
||||
<caret>val t = 2
|
||||
val aaa3 = 2
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: aaa1
|
||||
// ABSENT: aaa3
|
||||
@@ -0,0 +1 @@
|
||||
aaa<caret>
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo() {
|
||||
val aaa1 = 1
|
||||
val aaa2 = 2
|
||||
<caret>}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: aaa1, aaa2
|
||||
@@ -0,0 +1 @@
|
||||
aa<caret>
|
||||
@@ -0,0 +1,21 @@
|
||||
fun main(args: Array<String>) {
|
||||
val b: Base<String> = Derived()
|
||||
<caret>val a = 1
|
||||
}
|
||||
|
||||
open class Base<T> {
|
||||
fun funInBase(t: T): T { return t }
|
||||
|
||||
open fun funWithOverride(t: T): T { return t }
|
||||
open fun funWithoutOverride(t: T): T { return t }
|
||||
}
|
||||
|
||||
class Derived: Base<String>() {
|
||||
override fun funWithOverride(t: String): String { return "a" }
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: funInBase, funWithOverride, funWithoutOverride
|
||||
// NUMBER: 3
|
||||
|
||||
// RUNTIME_TYPE: Derived
|
||||
+1
@@ -0,0 +1 @@
|
||||
b.fun<caret>
|
||||
@@ -0,0 +1,25 @@
|
||||
fun main(args: Array<String>) {
|
||||
val b: A = C()
|
||||
<caret>val a = 1
|
||||
}
|
||||
|
||||
open class A {
|
||||
fun funA() {}
|
||||
private fun funAp() {}
|
||||
}
|
||||
|
||||
open class B: A() {
|
||||
fun funB() {}
|
||||
private fun funBp() {}
|
||||
}
|
||||
|
||||
class C: B() {
|
||||
fun funC() {}
|
||||
private fun funCp() {}
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 2
|
||||
// EXIST: funA, funAp, funB, funBp, funC, funCp
|
||||
// NUMBER: 6
|
||||
|
||||
// RUNTIME_TYPE: C
|
||||
+1
@@ -0,0 +1 @@
|
||||
b.fun<caret>
|
||||
@@ -0,0 +1,20 @@
|
||||
fun main(args: Array<String>) {
|
||||
val b: Base = Derived()
|
||||
<caret>val a = 1
|
||||
}
|
||||
|
||||
open class Base {
|
||||
}
|
||||
|
||||
class Derived: Base() {
|
||||
}
|
||||
|
||||
fun Derived.funExtDerived() { }
|
||||
fun Base.funExtBase() { }
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: funExtBase, funExtDerived
|
||||
// NUMBER: 2
|
||||
|
||||
|
||||
// RUNTIME_TYPE: Derived
|
||||
+1
@@ -0,0 +1 @@
|
||||
b.fun<caret>
|
||||
@@ -0,0 +1,24 @@
|
||||
fun main(args: Array<String>) {
|
||||
val b: Base = Derived()
|
||||
<caret>val a = 1
|
||||
}
|
||||
|
||||
open class Base {
|
||||
fun funInBase() {}
|
||||
|
||||
open fun funWithOverride() { }
|
||||
open fun funWithoutOverride() { }
|
||||
}
|
||||
|
||||
class Derived: Base() {
|
||||
fun funInDerived() { }
|
||||
|
||||
override fun funWithOverride() { }
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: funInBase, funWithOverride, funWithoutOverride, funInDerived
|
||||
// NUMBER: 4
|
||||
|
||||
|
||||
// RUNTIME_TYPE: Derived
|
||||
@@ -0,0 +1 @@
|
||||
b.fun<caret>
|
||||
@@ -0,0 +1,8 @@
|
||||
val aaabbbccc = 1
|
||||
|
||||
fun foo() {
|
||||
aaa<caret>bbbccc
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: aaabbbccc
|
||||
@@ -0,0 +1 @@
|
||||
aaabb<caret>
|
||||
@@ -0,0 +1,7 @@
|
||||
fun test() {
|
||||
val some = 1
|
||||
val f = 1.0f
|
||||
som<caret>
|
||||
}
|
||||
|
||||
// EXIST: some
|
||||
@@ -0,0 +1,8 @@
|
||||
fun Int.func(s: String): Int{}
|
||||
|
||||
fun test() {
|
||||
val floor = "Floor"
|
||||
val a = 1/**/f<caret>
|
||||
}
|
||||
|
||||
// EXIST: func
|
||||
@@ -0,0 +1,14 @@
|
||||
fun String?.forNullableString(){}
|
||||
fun Any?.forNullableAny(){}
|
||||
fun String.forString(){}
|
||||
fun Any.forAny(){}
|
||||
|
||||
fun foo(s: String?) {
|
||||
s.<caret>
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "forNullableString", attributes: "bold" }
|
||||
// EXIST: { lookupString: "forNullableAny", attributes: "" }
|
||||
// EXIST: { lookupString: "forString", attributes: "grayed" }
|
||||
// EXIST: { lookupString: "forAny", attributes: "grayed" }
|
||||
// EXIST: { lookupString: "compareTo", attributes: "grayed" }
|
||||
@@ -0,0 +1,16 @@
|
||||
fun String?.forNullableString(){}
|
||||
fun Any?.forNullableAny(){}
|
||||
fun String.forString(){}
|
||||
fun Any.forAny(){}
|
||||
|
||||
fun foo(o: Any?) {
|
||||
if (o is String) {
|
||||
o.<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "forNullableString", attributes: "" }
|
||||
// EXIST: { lookupString: "forNullableAny", attributes: "" }
|
||||
// EXIST: { lookupString: "forString", attributes: "bold" }
|
||||
// EXIST: { lookupString: "forAny", attributes: "" }
|
||||
// EXIST: { lookupString: "compareTo", attributes: "bold" }
|
||||
@@ -0,0 +1,30 @@
|
||||
trait T1 {
|
||||
fun inT1(){}
|
||||
}
|
||||
|
||||
trait T2 {
|
||||
fun inT2(){}
|
||||
}
|
||||
|
||||
fun T1.forT1(){}
|
||||
fun T2.forT2(){}
|
||||
fun T1?.forNullableT1(){}
|
||||
fun T2?.forNullableT2(){}
|
||||
fun Any.forAny(){}
|
||||
fun Any?.forNullableAny(){}
|
||||
|
||||
fun foo(o: T1?) {
|
||||
if (o is T2) {
|
||||
o.<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "inT1", attributes: "bold" }
|
||||
// EXIST: { lookupString: "inT2", attributes: "bold" }
|
||||
// EXIST: { lookupString: "hashCode", attributes: "" }
|
||||
// EXIST: { lookupString: "forT1", attributes: "bold" }
|
||||
// EXIST: { lookupString: "forT2", attributes: "bold" }
|
||||
// EXIST: { lookupString: "forNullableT1", attributes: "" }
|
||||
// EXIST: { lookupString: "forNullableT2", attributes: "" }
|
||||
// EXIST: { lookupString: "forAny", attributes: "" }
|
||||
// EXIST: { lookupString: "forNullableAny", attributes: "" }
|
||||
@@ -0,0 +1,26 @@
|
||||
var globalProperty = "abc" // has backing field and accessor but backing field is not accessible
|
||||
get() = $globalProperty + 1
|
||||
|
||||
class C {
|
||||
var property1 = "abc" // has backing field but accessors are default - no sense to show in completion
|
||||
|
||||
var property2 = "abc" // has backing field but accessors are also default
|
||||
private set
|
||||
|
||||
var property3: String // no backing field
|
||||
get() = "abc"
|
||||
set(value){}
|
||||
|
||||
var property4 = "abc" // has backing field and accessor
|
||||
get() = $property4 + 1
|
||||
|
||||
fun foo(){
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// ABSENT: $globalProperty
|
||||
// ABSENT: $property1
|
||||
// ABSENT: $property2
|
||||
// ABSENT: $property3
|
||||
// EXIST: { lookupString: "$property4", itemText: "$property4", tailText: null, typeText: "String" }
|
||||
@@ -0,0 +1,4 @@
|
||||
var globalProperty = "abc"
|
||||
get() = <caret>
|
||||
|
||||
// EXIST: $globalProperty
|
||||
@@ -0,0 +1,11 @@
|
||||
class C {
|
||||
var property = "abc"
|
||||
get() = $property + 1
|
||||
}
|
||||
|
||||
|
||||
fun foo(c: C){
|
||||
c.<caret>
|
||||
}
|
||||
|
||||
// ABSENT: $property
|
||||
@@ -0,0 +1,10 @@
|
||||
class C {
|
||||
var property = "abc"
|
||||
get() = $property + 1
|
||||
|
||||
fun foo() {
|
||||
this.<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: $property
|
||||
@@ -0,0 +1,15 @@
|
||||
class C {
|
||||
var property1 = "abc"
|
||||
get() = $property1 + 1
|
||||
var property2 = "abc"
|
||||
get() = $property2 + 1
|
||||
|
||||
fun foo(){
|
||||
$<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: $property1
|
||||
// EXIST: $property2
|
||||
// ABSENT: property1
|
||||
// ABSENT: property2
|
||||
@@ -0,0 +1,13 @@
|
||||
class C {
|
||||
var aProperty = "abc"
|
||||
get() {}
|
||||
var bProperty = "abc"
|
||||
get() {}
|
||||
|
||||
fun foo(){
|
||||
$a<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: $aProperty
|
||||
// ABSENT: $bProperty
|
||||
@@ -0,0 +1,15 @@
|
||||
class C {
|
||||
var property1 = "abc"
|
||||
get() = $property1 + 1
|
||||
var property2 = "abc"
|
||||
get() = $property2 + 1
|
||||
|
||||
fun foo(){
|
||||
"${$<caret>}"
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: $property1
|
||||
// EXIST: $property2
|
||||
// ABSENT: property1
|
||||
// ABSENT: property2
|
||||
@@ -0,0 +1,5 @@
|
||||
fun some() {
|
||||
var a : A<caret>
|
||||
}
|
||||
|
||||
// EXIST: Any
|
||||
@@ -0,0 +1,5 @@
|
||||
fun some() {
|
||||
var a : In<caret>
|
||||
}
|
||||
|
||||
// EXIST: Int
|
||||
@@ -0,0 +1,19 @@
|
||||
package testing
|
||||
|
||||
fun testTop() {
|
||||
|
||||
}
|
||||
|
||||
class TestSample() {
|
||||
fun main(args : Array<String>) {
|
||||
val testVar = ""
|
||||
test<caret>.testFun()
|
||||
}
|
||||
|
||||
fun testFun() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 2
|
||||
// EXIST: testVar, testFun, testTop
|
||||
@@ -0,0 +1,11 @@
|
||||
class TestClass {
|
||||
public fun testMethod() {
|
||||
}
|
||||
}
|
||||
|
||||
fun testFun() {
|
||||
val lambda = {() -> TestClass() }
|
||||
lambda().<caret>
|
||||
}
|
||||
|
||||
// EXIST: testMethod
|
||||
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
fun f() : A<caret>
|
||||
}
|
||||
|
||||
class A {
|
||||
fun f() : A
|
||||
}
|
||||
|
||||
// EXIST: A
|
||||
@@ -0,0 +1,9 @@
|
||||
class A {
|
||||
fun f() : A
|
||||
}
|
||||
|
||||
class A {
|
||||
fun f() : A<caret>
|
||||
}
|
||||
|
||||
// EXIST: A
|
||||
@@ -0,0 +1,10 @@
|
||||
val a: Int = 1
|
||||
get() {
|
||||
return $a
|
||||
}
|
||||
set(v) {
|
||||
$a = <caret>
|
||||
}
|
||||
|
||||
|
||||
// EXIST: a
|
||||
@@ -0,0 +1,8 @@
|
||||
/// KT-1187 Wrong unnecessary completion
|
||||
|
||||
fun anyfun() {
|
||||
a.b.c.d.e.f.<caret>
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// NUMBER: 0
|
||||
@@ -0,0 +1,8 @@
|
||||
/// KT-1187 Wrong unnecessary completion
|
||||
|
||||
fun anyfun() {
|
||||
a.b.c.d.e.f.<caret>
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 2
|
||||
// NUMBER: 0
|
||||
@@ -0,0 +1,13 @@
|
||||
open class MySecondClass() {
|
||||
}
|
||||
|
||||
open class MyFirstClass<T> {
|
||||
|
||||
}
|
||||
|
||||
class A() : My<caret> {
|
||||
public fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: MySecondClass, MyFirstClass
|
||||
@@ -0,0 +1,16 @@
|
||||
package Test.SubTest.AnotherTest
|
||||
|
||||
open class TestClass {
|
||||
}
|
||||
|
||||
fun globalFun(){}
|
||||
val globalProp: Int = 1
|
||||
|
||||
class A() : Test.SubTest.AnotherTest.<caret> {
|
||||
public fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: TestClass
|
||||
// ABSENT: globalFun
|
||||
// ABSENT: globalProp
|
||||
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
val St<caret>
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: { lookupString:"String", tailText:" (kotlin)" }
|
||||
// EXIST: IllegalStateException
|
||||
// EXIST: StringBuilder
|
||||
// EXIST_JAVA_ONLY: StringBuffer
|
||||
// ABSENT: HTMLStyleElement
|
||||
// ABSENT: Statement
|
||||
@@ -0,0 +1,11 @@
|
||||
fun testing() {}
|
||||
|
||||
fun S<caret>
|
||||
|
||||
// Should complete types for receiver after explicit basic completion call
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: String
|
||||
// EXIST_JAVA_ONLY: StringBuffer
|
||||
// EXIST: Set
|
||||
// ABSENT: testing
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
val St<caret>
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 2
|
||||
// EXIST: { lookupString:"String", tailText:" (kotlin)" }
|
||||
// EXIST: IllegalStateException
|
||||
// EXIST: StringBuilder
|
||||
// EXIST_JAVA_ONLY: StringBuffer
|
||||
// EXIST_JS_ONLY: HTMLStyleElement
|
||||
// EXIST_JAVA_ONLY: { lookupString:"Statement", tailText:" (java.sql)" }
|
||||
@@ -0,0 +1,13 @@
|
||||
package p
|
||||
|
||||
class B
|
||||
|
||||
class R {
|
||||
companion object {
|
||||
fun B.f() {
|
||||
this.<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { itemText: "f", tailText: "() for B in R.Companion" }
|
||||
@@ -0,0 +1,22 @@
|
||||
class StrSome {
|
||||
class StrOther
|
||||
|
||||
fun more() {
|
||||
class StrInFun
|
||||
|
||||
fun Str<caret>
|
||||
}
|
||||
}
|
||||
|
||||
class StrMore {
|
||||
class StrAbsent
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: { lookupString:"String", tailText:" (kotlin)" }
|
||||
// EXIST: StrSome
|
||||
// EXIST: StrMore
|
||||
// EXIST: StrInFun
|
||||
// EXIST: StringBuilder
|
||||
// EXIST_JAVA_ONLY: StringBuffer
|
||||
// ABSENT: StrAbsent
|
||||
@@ -0,0 +1,6 @@
|
||||
val Int.f: Float get() = this.toFloat()
|
||||
|
||||
val test = 1.<caret>
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: f
|
||||
@@ -0,0 +1,14 @@
|
||||
open class Base
|
||||
|
||||
class Test
|
||||
fun <T> Test.extensionEmpty(param: T) = "Test"
|
||||
fun <T: Base> Test.extensionBase(param: T) = "Test"
|
||||
fun <T: Base, P> Test.extensionTwo(param: T) = "Test"
|
||||
|
||||
fun some() {
|
||||
Test().ex<caret>
|
||||
}
|
||||
|
||||
// EXIST: extensionEmpty
|
||||
// EXIST: extensionBase
|
||||
// EXIST: extensionTwo
|
||||
@@ -0,0 +1,14 @@
|
||||
open class Base
|
||||
open class OtherBase
|
||||
|
||||
class Some<T>
|
||||
fun <TSome : Base, R : Base> Some<TSome>.extensionBase(param: R) = "Test"
|
||||
fun <TSome : OtherBase, R : OtherBase> Some<TSome>.extensionOtherBase(param: R) = "Test"
|
||||
fun <TSome> Some<TSome>.extensionExact() = "Test"
|
||||
|
||||
fun test() {
|
||||
Some<Base>().ex<caret>
|
||||
}
|
||||
|
||||
// EXIST: extensionBase, extensionExact
|
||||
// ABSENT: extensionOtherBase
|
||||
@@ -0,0 +1,22 @@
|
||||
open class Base
|
||||
open class SubBase:Base()
|
||||
open class SubSubBase:SubBase()
|
||||
open class OtherBase
|
||||
|
||||
fun <T: Base> T.extensionSomeBase() = 12
|
||||
fun <T: SubBase> T.extensionSomeSubBase() = 12
|
||||
fun <T: SubSubBase> T.extensionSomeSubSubBase() = 12
|
||||
fun <T: Base> T?.extensionSomeNull() = 12
|
||||
fun <T: Base?> T.extensionSomeNullParam() = 12
|
||||
fun <T: OtherBase> T.extensionSomeOtherBase() = 12
|
||||
|
||||
fun some() {
|
||||
SubBase().extensionSome<caret>
|
||||
}
|
||||
|
||||
// EXIST: extensionSomeBase
|
||||
// EXIST: extensionSomeSubBase
|
||||
// EXIST: extensionSomeNull
|
||||
// EXIST: extensionSomeNullParam
|
||||
// ABSENT: extensionSomeOtherBase
|
||||
// ABSENT: extensionSomeSubSubBase
|
||||
@@ -0,0 +1,11 @@
|
||||
import java.util.HashSet
|
||||
|
||||
open class Base
|
||||
|
||||
fun <T: Base> Set<List<T>>.extensionInternal() = 12
|
||||
|
||||
fun some() {
|
||||
HashSet<List<Base>>().ex<caret>
|
||||
}
|
||||
|
||||
// EXIST: extensionInternal
|
||||
@@ -0,0 +1,18 @@
|
||||
open class Base
|
||||
|
||||
class ManySome<T, U>
|
||||
fun <P1, P2>ManySome<P1, P2>.testExactGeneralGeneral() = "Some"
|
||||
fun <P1, P2>ManySome<P1, Int>.testExactGeneralInt() = "Some"
|
||||
fun <P1, P2>ManySome<Int, Int>.testExactIntInt() = "Some"
|
||||
fun <P1 : Base, P2>ManySome<P1, Int>.testSubBaseIntInt() = "Some"
|
||||
fun <P1, P2, P3>ManySome<P1, P2>.testManyGeneralGeneral() = "Some"
|
||||
|
||||
fun some() {
|
||||
ManySome<Int, Int>().test<caret>
|
||||
}
|
||||
|
||||
// EXIST: testExactGeneralGeneral
|
||||
// EXIST: testExactGeneralInt
|
||||
// EXIST: testExactIntInt
|
||||
// EXIST: testManyGeneralGeneral
|
||||
// ABSENT: testSubBaseIntInt
|
||||
@@ -0,0 +1,11 @@
|
||||
package Tests
|
||||
|
||||
import java.util.*
|
||||
|
||||
fun hello() {
|
||||
val a = So<caret>
|
||||
}
|
||||
|
||||
// EXIST: SortedSet
|
||||
// EXIST_JAVA_ONLY: SortedMap
|
||||
// EXIST_JS_ONLY: JSON
|
||||
@@ -0,0 +1,7 @@
|
||||
fun test(a: Int) {}
|
||||
|
||||
fun some() {
|
||||
tes<caret>
|
||||
}
|
||||
|
||||
// EXIST: { lookupString:"test", itemText:"test", tailText:"(a: Int) (<root>)" }
|
||||
@@ -0,0 +1,7 @@
|
||||
fun bar() {
|
||||
val handler = { <caret> }
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 0
|
||||
// EXIST: bar
|
||||
// EXIST: null
|
||||
@@ -0,0 +1,7 @@
|
||||
fun bar() {
|
||||
val handler = { (<caret>) }
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 0
|
||||
// EXIST: bar
|
||||
// EXIST: null
|
||||
@@ -0,0 +1,5 @@
|
||||
fun bar() {
|
||||
val handler = { (i: Int, <caret>) }
|
||||
}
|
||||
|
||||
// NUMBER: 0
|
||||
@@ -0,0 +1,5 @@
|
||||
fun bar() {
|
||||
val handler = { (i, <caret>) }
|
||||
}
|
||||
|
||||
// NUMBER: 0
|
||||
@@ -0,0 +1,5 @@
|
||||
fun bar() {
|
||||
val handler = { i, <caret> }
|
||||
}
|
||||
|
||||
// NUMBER: 0
|
||||
@@ -0,0 +1,9 @@
|
||||
fun bar() {
|
||||
val handler = { <caret>
|
||||
foo()
|
||||
}
|
||||
}
|
||||
|
||||
// INVOCATION_COUNT: 0
|
||||
// EXIST: bar
|
||||
// EXIST: null
|
||||
@@ -0,0 +1,8 @@
|
||||
fun bar() {
|
||||
val handler = { (i: <caret>) }
|
||||
}
|
||||
|
||||
// EXIST: Int
|
||||
// EXIST: String
|
||||
// ABSENT: bar
|
||||
// ABSENT: handler
|
||||
@@ -0,0 +1,8 @@
|
||||
fun bar() {
|
||||
val handler = { (i: <caret> }
|
||||
}
|
||||
|
||||
// EXIST: Int
|
||||
// EXIST: String
|
||||
// ABSENT: bar
|
||||
// ABSENT: handler
|
||||
@@ -0,0 +1,8 @@
|
||||
fun bar() {
|
||||
val handler = { (i: Int, s: <caret> }
|
||||
}
|
||||
|
||||
// EXIST: Int
|
||||
// EXIST: String
|
||||
// ABSENT: bar
|
||||
// ABSENT: handler
|
||||
@@ -0,0 +1,8 @@
|
||||
fun bar() {
|
||||
val handler = { (i: List<<caret>>) }
|
||||
}
|
||||
|
||||
// EXIST: Int
|
||||
// EXIST: String
|
||||
// ABSENT: bar
|
||||
// ABSENT: handler
|
||||
@@ -0,0 +1,8 @@
|
||||
fun bar() {
|
||||
val handler = { (i: Map<String, <caret> }
|
||||
}
|
||||
|
||||
// EXIST: Int
|
||||
// EXIST: String
|
||||
// ABSENT: bar
|
||||
// ABSENT: handler
|
||||
@@ -0,0 +1,6 @@
|
||||
fun f(p: (String) -> Unit, s: String) {
|
||||
p(<caret>)
|
||||
}
|
||||
|
||||
// EXIST: s
|
||||
// EXIST: StringBuilder
|
||||
@@ -0,0 +1,8 @@
|
||||
fun foo() {}
|
||||
|
||||
fun <T> S<caret>
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: String
|
||||
// EXIST: Set
|
||||
// ABSENT: foo
|
||||
@@ -0,0 +1,11 @@
|
||||
class Foo{}
|
||||
|
||||
fun foo() {}
|
||||
|
||||
fun <T> <caret>
|
||||
|
||||
// INVOCATION_COUNT: 1
|
||||
// EXIST: Foo
|
||||
// EXIST: String
|
||||
// EXIST: Set
|
||||
// ABSENT: foo
|
||||
@@ -0,0 +1,8 @@
|
||||
fun Strange(){}
|
||||
|
||||
fun Annotations<S<caret>
|
||||
|
||||
// INVOCATION_COUNT: 0
|
||||
// EXIST: String
|
||||
// EXIST: Set
|
||||
// ABSENT: Strange
|
||||
@@ -0,0 +1,7 @@
|
||||
fun Strange(){}
|
||||
|
||||
fun Map<() -> Unit, Str<caret>
|
||||
|
||||
// INVOCATION_COUNT: 0
|
||||
// EXIST: String
|
||||
// ABSENT: Strange
|
||||
@@ -0,0 +1,8 @@
|
||||
class Generic1<T>
|
||||
|
||||
class Generic2<T1, T2>
|
||||
|
||||
fun foo(): G<caret>
|
||||
|
||||
// EXIST: { lookupString: "Generic1", itemText: "Generic1", tailText: "<T> (<root>)" }
|
||||
// EXIST: { lookupString: "Generic2", itemText: "Generic2", tailText: "<T1, T2> (<root>)" }
|
||||
@@ -0,0 +1,8 @@
|
||||
fun foo(p: (String, Char) -> Unit){}
|
||||
|
||||
fun test() {
|
||||
fo<caret>
|
||||
}
|
||||
|
||||
// EXIST: { lookupString:"foo", itemText: "foo", tailText: "(p: (String, Char) -> Unit) (<root>)", typeText:"Unit" }
|
||||
// EXIST: { lookupString:"foo", itemText: "foo", tailText: " { String, Char -> ... } (<root>)", typeText:"Unit" }
|
||||
@@ -0,0 +1,8 @@
|
||||
fun String.foo(p: (String, Char) -> Unit){}
|
||||
|
||||
fun test() {
|
||||
"".fo<caret>
|
||||
}
|
||||
|
||||
// EXIST: { lookupString:"foo", itemText: "foo", tailText: "(p: (String, Char) -> Unit) for String in <root>", typeText:"Unit" }
|
||||
// EXIST: { lookupString:"foo", itemText: "foo", tailText: " { String, Char -> ... } for String in <root>", typeText:"Unit" }
|
||||
@@ -0,0 +1,18 @@
|
||||
fun String.extFunForString(){}
|
||||
fun Any.extFunForAny(){}
|
||||
fun String?.extFunForStringNullable(){}
|
||||
|
||||
class C {
|
||||
fun Any.memberExtFunForAny(){}
|
||||
fun String?.memberExtFunForStringNullable(){}
|
||||
|
||||
fun foo() {
|
||||
"".<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { itemText: "extFunForString", attributes: "bold" }
|
||||
// EXIST: { itemText: "extFunForAny", attributes: "" }
|
||||
// EXIST: { itemText: "extFunForStringNullable", attributes: "" }
|
||||
// EXIST: { itemText: "memberExtFunForAny", attributes: "" }
|
||||
// EXIST: { itemText: "memberExtFunForStringNullable", attributes: "" }
|
||||
@@ -0,0 +1,15 @@
|
||||
fun String.extFunForString(){}
|
||||
fun Any.extFunForAny(){}
|
||||
fun String?.extFunForStringNullable(){}
|
||||
|
||||
class C {
|
||||
fun foo(s: String?) {
|
||||
if (s != null) {
|
||||
s.<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { itemText: "extFunForString", attributes: "bold" }
|
||||
// EXIST: { itemText: "extFunForAny", attributes: "" }
|
||||
// EXIST: { itemText: "extFunForStringNullable", attributes: "" }
|
||||
@@ -0,0 +1,17 @@
|
||||
fun C.extFunForC(){}
|
||||
fun D.extFunForD(){}
|
||||
fun Any.extFunForAny(){}
|
||||
|
||||
open class C {
|
||||
fun foo() {
|
||||
if (this is D) {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class D : C
|
||||
|
||||
// EXIST: { itemText: "extFunForD", attributes: "bold" }
|
||||
// EXIST: { itemText: "extFunForC", attributes: "" }
|
||||
// EXIST: { itemText: "extFunForAny", attributes: "" }
|
||||
@@ -0,0 +1,17 @@
|
||||
fun C.extFunForC(){}
|
||||
fun T.extFunForT(){}
|
||||
fun Any.extFunForAny(){}
|
||||
|
||||
open class C {
|
||||
fun foo() {
|
||||
if (this is T) {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
trait T
|
||||
|
||||
// EXIST: { itemText: "extFunForT", attributes: "bold" }
|
||||
// EXIST: { itemText: "extFunForC", attributes: "bold" }
|
||||
// EXIST: { itemText: "extFunForAny", attributes: "" }
|
||||
@@ -0,0 +1,23 @@
|
||||
trait T {
|
||||
fun fromTrait(){}
|
||||
}
|
||||
|
||||
abstract class Base : T {
|
||||
fun fromBase(){}
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
override fun fromTrait() { }
|
||||
|
||||
fun fromDerived(){}
|
||||
}
|
||||
|
||||
fun foo(d: Derived) {
|
||||
d.<caret>
|
||||
}
|
||||
|
||||
// EXIST: { itemText: "fromTrait", attributes: "bold" }
|
||||
// EXIST: { itemText: "fromDerived", attributes: "bold" }
|
||||
// EXIST: { itemText: "fromBase", attributes: "" }
|
||||
// EXIST: { itemText: "hashCode", attributes: "" }
|
||||
// EXIST: { itemText: "equals", attributes: "" }
|
||||
@@ -0,0 +1,25 @@
|
||||
trait T {
|
||||
fun fromTrait(){}
|
||||
}
|
||||
|
||||
abstract class Base : T {
|
||||
fun fromBase(){}
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
override fun fromTrait() { }
|
||||
|
||||
fun fromDerived(){}
|
||||
}
|
||||
|
||||
fun foo(o: Any) {
|
||||
if (o is Derived) {
|
||||
o.<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { itemText: "fromTrait", attributes: "bold" }
|
||||
// EXIST: { itemText: "fromDerived", attributes: "bold" }
|
||||
// EXIST: { itemText: "fromBase", attributes: "" }
|
||||
// EXIST: { itemText: "hashCode", attributes: "" }
|
||||
// EXIST: { itemText: "equals", attributes: "" }
|
||||
@@ -0,0 +1,14 @@
|
||||
trait T {
|
||||
fun f(){}
|
||||
}
|
||||
|
||||
fun foo(o: T) {
|
||||
if (o is Runnable) {
|
||||
o.<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { itemText: "run", attributes: "bold" }
|
||||
// EXIST: { itemText: "f", attributes: "bold" }
|
||||
// EXIST: { itemText: "hashCode", attributes: "" }
|
||||
// EXIST: { itemText: "equals", attributes: "" }
|
||||
@@ -0,0 +1,16 @@
|
||||
trait T {
|
||||
fun foo1(){}
|
||||
fun foo2(){}
|
||||
}
|
||||
|
||||
class B(worker: T) : T by worker {
|
||||
override fun foo1() { }
|
||||
}
|
||||
|
||||
fun foo(b: B) {
|
||||
b.<caret>
|
||||
}
|
||||
|
||||
// EXIST: { itemText: "foo1", attributes: "bold" }
|
||||
// EXIST: { itemText: "foo2", attributes: "" }
|
||||
// EXIST: { itemText: "equals", attributes: "" }
|
||||
@@ -0,0 +1,27 @@
|
||||
fun globalFun(){}
|
||||
|
||||
trait T {
|
||||
fun fromTrait(){}
|
||||
}
|
||||
|
||||
abstract class Base : T {
|
||||
fun fromBase(){}
|
||||
}
|
||||
|
||||
class Derived : Base() {
|
||||
override fun fromTrait() { }
|
||||
|
||||
fun fromDerived(){}
|
||||
|
||||
fun foo(d: Derived) {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { itemText: "foo", attributes: "bold" }
|
||||
// EXIST: { itemText: "fromTrait", attributes: "bold" }
|
||||
// EXIST: { itemText: "fromDerived", attributes: "bold" }
|
||||
// EXIST: { itemText: "fromBase", attributes: "" }
|
||||
// EXIST: { itemText: "hashCode", attributes: "" }
|
||||
// EXIST: { itemText: "equals", attributes: "" }
|
||||
// EXIST: { itemText: "globalFun", attributes: "" }
|
||||
@@ -0,0 +1,10 @@
|
||||
package p
|
||||
|
||||
import java.lang.Character.*
|
||||
|
||||
fun foo() {
|
||||
M<caret>
|
||||
}
|
||||
|
||||
// EXIST_JAVA_ONLY: MIN_RADIX
|
||||
// EXIST_JAVA_ONLY: MATH_SYMBOL
|
||||
@@ -0,0 +1,13 @@
|
||||
package something
|
||||
|
||||
class SomeTempClass {
|
||||
fun helloWorld() {
|
||||
|
||||
}
|
||||
|
||||
fun test() {
|
||||
hello<caret>()
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: helloWorld
|
||||
@@ -0,0 +1,12 @@
|
||||
val testExternal
|
||||
|
||||
class Some(testParam : Int) {
|
||||
private val myVal : Int
|
||||
|
||||
{
|
||||
val testing = 12
|
||||
myVal = test<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: testParam, testExternal, testing
|
||||
@@ -0,0 +1,25 @@
|
||||
class C {
|
||||
val field = 0
|
||||
class NestedClass
|
||||
inner class InnerClass
|
||||
object AnObject
|
||||
|
||||
companion object {
|
||||
val classObjectField = 0
|
||||
class ClassObjectClass
|
||||
|
||||
fun foo(){
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun C.extensionForC(){}
|
||||
|
||||
// ABSENT: field
|
||||
// EXIST: NestedClass
|
||||
// EXIST: InnerClass
|
||||
// EXIST: AnObject
|
||||
// EXIST: classObjectField
|
||||
// EXIST: ClassObjectClass
|
||||
// ABSENT: extensionForC
|
||||
@@ -0,0 +1,9 @@
|
||||
class Test(val testParam : Int) {
|
||||
val x : Int get() {
|
||||
val test = 12
|
||||
return te<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: test
|
||||
// EXIST: testParam
|
||||
@@ -0,0 +1,8 @@
|
||||
package Test
|
||||
|
||||
import <caret>
|
||||
|
||||
// EXIST: java,
|
||||
// EXIST_JAVA_ONLY: javax
|
||||
// EXIST_JS_ONLY: jquery, html5
|
||||
// ABSENT: Array, Integer
|
||||
@@ -0,0 +1,8 @@
|
||||
class Test {
|
||||
fun test() {
|
||||
val some : <caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: Any, Nothing, Unit, Int, Number, Array
|
||||
// EXIST_JAVA_ONLY: Math, Thread
|
||||
@@ -0,0 +1,7 @@
|
||||
class Test : <caret> {
|
||||
fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: Any, Nothing, Unit, Int, Number, Array
|
||||
// EXIST_JAVA_ONLY: Math, Thread
|
||||
@@ -0,0 +1,12 @@
|
||||
data class LocalData(val first : Int, val second : Int)
|
||||
|
||||
val (localFirst, localSecond) = LocalData(11, 12)
|
||||
|
||||
fun test() {
|
||||
local<caret>
|
||||
}
|
||||
|
||||
// Test that this test won't fail with exception
|
||||
// Regression for EA-39175
|
||||
|
||||
// ABSENT: localFirst, localSecond
|
||||
@@ -0,0 +1,9 @@
|
||||
class TestClassName
|
||||
type TestAlias = TestClassName
|
||||
|
||||
val a: Tes<caret>
|
||||
|
||||
// Regression for EA-38287 and KT-2758
|
||||
|
||||
// EXIST: TestClassName
|
||||
// ABSENT: TestAlias
|
||||
@@ -0,0 +1,11 @@
|
||||
val some = 12
|
||||
class Some(someParam : Int) {
|
||||
{
|
||||
fun internalFun(someInternal : Int) : Int {
|
||||
return some<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: some, someInternal, someParam
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
class Foo {
|
||||
fun add(a: Any) {}
|
||||
}
|
||||
|
||||
|
||||
fun test() {
|
||||
val foo = Foo()
|
||||
foo.add(AL<caret>)
|
||||
}
|
||||
|
||||
/* For KT-3779, KT-2821 */
|
||||
|
||||
// INVOCATION_COUNT: 2
|
||||
// EXIST: ArrayList
|
||||
@@ -0,0 +1,9 @@
|
||||
fun foo(p: Iterable<D>) {
|
||||
p.filter { it.<caret> }
|
||||
}
|
||||
|
||||
trait D {
|
||||
fun bar()
|
||||
}
|
||||
|
||||
// EXIST: bar
|
||||
@@ -0,0 +1,7 @@
|
||||
val testing = 12
|
||||
val test = "Hello"
|
||||
|
||||
val more = test<caret>
|
||||
|
||||
// EXIST: { lookupString: "test", itemText: "test", tailText: " (<root>)", typeText: "String", attributes: "" }
|
||||
// EXIST: { lookupString: "testing", itemText: "testing", tailText: " (<root>)", typeText: "Int", attributes: "" }
|
||||
@@ -0,0 +1,10 @@
|
||||
package Test
|
||||
|
||||
import java.util.<caret>
|
||||
|
||||
class Test {
|
||||
|
||||
}
|
||||
|
||||
// EXIST: AbstractList, Date
|
||||
// EXIST_JAVA_ONLY: Random, concurrent
|
||||
@@ -0,0 +1,11 @@
|
||||
val testGlobal = 12
|
||||
|
||||
val test : Int get() {
|
||||
class SomeMore(testParam : Int) {
|
||||
{
|
||||
tes<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: testGlobal, test, testParam
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user