diff --git a/idea/testData/completion/basic/multifile/DoNotCompleteWithConstraints-1.kt b/idea/testData/completion/basic/multifile/DoNotCompleteWithConstraints-1.kt new file mode 100644 index 00000000000..2bc456b90ab --- /dev/null +++ b/idea/testData/completion/basic/multifile/DoNotCompleteWithConstraints-1.kt @@ -0,0 +1,15 @@ +package first + +trait TestedTrait() { +} + +fun firstFun() { + val a = second.SomeTest() + a.testing +} + +// EXIST: testingMethod +// EXIST: testingExpectedFunction +// ABSENT: testingUnexpectedFunction + +// NUMBER: 2 \ No newline at end of file diff --git a/idea/testData/completion/basic/multifile/DoNotCompleteWithConstraints-2.kt b/idea/testData/completion/basic/multifile/DoNotCompleteWithConstraints-2.kt new file mode 100644 index 00000000000..4614b598b5e --- /dev/null +++ b/idea/testData/completion/basic/multifile/DoNotCompleteWithConstraints-2.kt @@ -0,0 +1,16 @@ +package second + +open class SomeOther() {} + +class SomeTest { + fun testingMethod() { + + } +} + +fun SomeTest.testingUnexpectedFunction() { +} + +fun SomeTest.testingExpectedFunction(i : Int) : String { + return "" +} \ No newline at end of file diff --git a/idea/testData/completion/basic/multifile/ExtensionFunctionOnUnresolved-1.kt b/idea/testData/completion/basic/multifile/ExtensionFunctionOnUnresolved-1.kt new file mode 100644 index 00000000000..784ac599a7a --- /dev/null +++ b/idea/testData/completion/basic/multifile/ExtensionFunctionOnUnresolved-1.kt @@ -0,0 +1,11 @@ +package first + +fun firstFun() { + val a = SomeUnknownClass() + a.hello +} + +// ABSENT: helloFun +// ABSENT: helloFunPreventAutoInsert +// ABSENT: helloWithParams +// NUMBER: 0 \ No newline at end of file diff --git a/idea/testData/completion/basic/multifile/ExtensionFunctionOnUnresolved-2.kt b/idea/testData/completion/basic/multifile/ExtensionFunctionOnUnresolved-2.kt new file mode 100644 index 00000000000..26ba80640b4 --- /dev/null +++ b/idea/testData/completion/basic/multifile/ExtensionFunctionOnUnresolved-2.kt @@ -0,0 +1,11 @@ +package second + +fun String.helloFun() { +} + +fun String.helloWithParams(i : Int) : String { + return "" +} + +fun String.helloFunPreventAutoInsert() { +} \ No newline at end of file diff --git a/idea/testData/completion/basic/multifile/ExtensionProperty-1.kt b/idea/testData/completion/basic/multifile/ExtensionProperty-1.kt new file mode 100644 index 00000000000..45b5e8b4acc --- /dev/null +++ b/idea/testData/completion/basic/multifile/ExtensionProperty-1.kt @@ -0,0 +1,12 @@ +package first + +import second.SomeTestClass + +fun firstFun() { + SomeTestClass().some +} + +// EXIST: someProperty +// EXIST: someOtherProperty +// EXIST: someSelfProperty +// NUMBER: 3 \ No newline at end of file diff --git a/idea/testData/completion/basic/multifile/ExtensionProperty-2.kt b/idea/testData/completion/basic/multifile/ExtensionProperty-2.kt new file mode 100644 index 00000000000..a8e890a7fa3 --- /dev/null +++ b/idea/testData/completion/basic/multifile/ExtensionProperty-2.kt @@ -0,0 +1,8 @@ +package second + +class SomeTestClass() { +} + +val SomeTestClass.someProperty = 12 +var SomeTestClass.someOtherProperty = "" +val SomeTestClass.someSelfProperty = SomeTestClass() \ No newline at end of file diff --git a/idea/testData/completion/basic/multifile/NotImportedExtensionFunction-1.kt b/idea/testData/completion/basic/multifile/NotImportedExtensionFunction-1.kt index 4e1c556cdcf..dda68250d5e 100644 --- a/idea/testData/completion/basic/multifile/NotImportedExtensionFunction-1.kt +++ b/idea/testData/completion/basic/multifile/NotImportedExtensionFunction-1.kt @@ -8,4 +8,5 @@ fun firstFun() { // EXIST: helloFun // EXIST: helloFunPreventAutoInsert // EXIST: helloWithParams +// ABSENT: helloFake // NUMBER: 3 \ No newline at end of file diff --git a/idea/testData/completion/basic/multifile/NotImportedExtensionFunction-2.kt b/idea/testData/completion/basic/multifile/NotImportedExtensionFunction-2.kt index 26ba80640b4..0d782748e87 100644 --- a/idea/testData/completion/basic/multifile/NotImportedExtensionFunction-2.kt +++ b/idea/testData/completion/basic/multifile/NotImportedExtensionFunction-2.kt @@ -8,4 +8,7 @@ fun String.helloWithParams(i : Int) : String { } fun String.helloFunPreventAutoInsert() { +} + +fun Int.helloFake() { } \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/completion/JetMultifileBasicCompletionTest.java b/idea/tests/org/jetbrains/jet/completion/JetMultifileBasicCompletionTest.java index 71b6e4a6cca..690ad171ccd 100644 --- a/idea/tests/org/jetbrains/jet/completion/JetMultifileBasicCompletionTest.java +++ b/idea/tests/org/jetbrains/jet/completion/JetMultifileBasicCompletionTest.java @@ -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); }