KT-1151 Code completion for not imported extension functions - more tests for extension functions and properties
This commit is contained in:
@@ -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: helloFun
|
||||||
// EXIST: helloFunPreventAutoInsert
|
// EXIST: helloFunPreventAutoInsert
|
||||||
// EXIST: helloWithParams
|
// EXIST: helloWithParams
|
||||||
|
// ABSENT: helloFake
|
||||||
// NUMBER: 3
|
// NUMBER: 3
|
||||||
@@ -8,4 +8,7 @@ fun String.helloWithParams(i : Int) : String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun String.helloFunPreventAutoInsert() {
|
fun String.helloFunPreventAutoInsert() {
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Int.helloFake() {
|
||||||
}
|
}
|
||||||
@@ -23,10 +23,22 @@ import org.jetbrains.jet.plugin.PluginTestCaseBase;
|
|||||||
*/
|
*/
|
||||||
public class JetMultifileBasicCompletionTest extends JetCompletionMultiTestBase {
|
public class JetMultifileBasicCompletionTest extends JetCompletionMultiTestBase {
|
||||||
|
|
||||||
|
public void testDoNotCompleteWithConstraints() {
|
||||||
|
doFileTest(2);
|
||||||
|
}
|
||||||
|
|
||||||
public void testTopLevelFunction() throws Exception {
|
public void testTopLevelFunction() throws Exception {
|
||||||
doFileTest(2);
|
doFileTest(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void todotestExtensionFunctionOnUnresolved() throws Exception {
|
||||||
|
doFileTest(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void todotestExtensionProperty() throws Exception {
|
||||||
|
doFileTest(2);
|
||||||
|
}
|
||||||
|
|
||||||
public void testNotImportedExtensionFunction() throws Exception {
|
public void testNotImportedExtensionFunction() throws Exception {
|
||||||
doFileTest(2);
|
doFileTest(2);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user