KT-1151 Code completion for not imported extension functions - more tests for extension functions and properties

This commit is contained in:
Nikolay Krasko
2012-02-28 22:04:49 +04:00
parent 67dc9ba6e3
commit a086e3985e
9 changed files with 89 additions and 0 deletions
@@ -0,0 +1,15 @@
package first
trait TestedTrait() {
}
fun firstFun() {
val a = second.SomeTest<TestedTrait>()
a.testing<caret>
}
// EXIST: testingMethod
// EXIST: testingExpectedFunction
// ABSENT: testingUnexpectedFunction
// NUMBER: 2
@@ -0,0 +1,16 @@
package second
open class SomeOther() {}
class SomeTest<T> {
fun testingMethod() {
}
}
fun <U : SomeOther> SomeTest<U>.testingUnexpectedFunction() {
}
fun <W : Any> SomeTest<W>.testingExpectedFunction(i : Int) : String {
return ""
}
@@ -0,0 +1,11 @@
package first
fun firstFun() {
val a = SomeUnknownClass()
a.hello<caret>
}
// ABSENT: helloFun
// ABSENT: helloFunPreventAutoInsert
// ABSENT: helloWithParams
// NUMBER: 0
@@ -0,0 +1,11 @@
package second
fun String.helloFun() {
}
fun String.helloWithParams(i : Int) : String {
return ""
}
fun String.helloFunPreventAutoInsert() {
}
@@ -0,0 +1,12 @@
package first
import second.SomeTestClass
fun firstFun() {
SomeTestClass().some<caret>
}
// EXIST: someProperty
// EXIST: someOtherProperty
// EXIST: someSelfProperty
// NUMBER: 3
@@ -0,0 +1,8 @@
package second
class SomeTestClass() {
}
val SomeTestClass.someProperty = 12
var SomeTestClass.someOtherProperty = ""
val SomeTestClass.someSelfProperty = SomeTestClass()
@@ -8,4 +8,5 @@ fun firstFun() {
// EXIST: helloFun
// EXIST: helloFunPreventAutoInsert
// EXIST: helloWithParams
// ABSENT: helloFake
// NUMBER: 3
@@ -8,4 +8,7 @@ fun String.helloWithParams(i : Int) : String {
}
fun String.helloFunPreventAutoInsert() {
}
fun Int.helloFake() {
}
@@ -23,10 +23,22 @@ import org.jetbrains.jet.plugin.PluginTestCaseBase;
*/
public class JetMultifileBasicCompletionTest extends JetCompletionMultiTestBase {
public void testDoNotCompleteWithConstraints() {
doFileTest(2);
}
public void testTopLevelFunction() throws Exception {
doFileTest(2);
}
public void todotestExtensionFunctionOnUnresolved() throws Exception {
doFileTest(2);
}
public void todotestExtensionProperty() throws Exception {
doFileTest(2);
}
public void testNotImportedExtensionFunction() throws Exception {
doFileTest(2);
}