提交 a086e398 编写于 作者: N Nikolay Krasko

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

KT-1151 Code completion for not imported extension functions - more tests for extension functions and properties
上级 67dc9ba6
package first
trait TestedTrait() {
}
fun firstFun() {
val a = second.SomeTest<TestedTrait>()
a.testing<caret>
}
// EXIST: testingMethod
// EXIST: testingExpectedFunction
// ABSENT: testingUnexpectedFunction
// NUMBER: 2
\ No newline at end of file
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 ""
}
\ No newline at end of file
package first
fun firstFun() {
val a = SomeUnknownClass()
a.hello<caret>
}
// ABSENT: helloFun
// ABSENT: helloFunPreventAutoInsert
// ABSENT: helloWithParams
// NUMBER: 0
\ No newline at end of file
package second
fun String.helloFun() {
}
fun String.helloWithParams(i : Int) : String {
return ""
}
fun String.helloFunPreventAutoInsert() {
}
\ No newline at end of file
package first
import second.SomeTestClass
fun firstFun() {
SomeTestClass().some<caret>
}
// EXIST: someProperty
// EXIST: someOtherProperty
// EXIST: someSelfProperty
// NUMBER: 3
\ No newline at end of file
package second
class SomeTestClass() {
}
val SomeTestClass.someProperty = 12
var SomeTestClass.someOtherProperty = ""
val SomeTestClass.someSelfProperty = SomeTestClass()
\ No newline at end of file
......@@ -8,4 +8,5 @@ fun firstFun() {
// EXIST: helloFun
// EXIST: helloFunPreventAutoInsert
// EXIST: helloWithParams
// ABSENT: helloFake
// NUMBER: 3
\ No newline at end of file
......@@ -8,4 +8,7 @@ fun String.helloWithParams(i : Int) : String {
}
fun String.helloFunPreventAutoInsert() {
}
fun Int.helloFake() {
}
\ No newline at end of file
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册