diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/ExpressionsOfTypeProcessor.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/ExpressionsOfTypeProcessor.kt index 9883f3c63be..a1a5b39ef1c 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/ExpressionsOfTypeProcessor.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/ExpressionsOfTypeProcessor.kt @@ -71,7 +71,7 @@ class ExpressionsOfTypeProcessor( var mode = if (ApplicationManager.getApplication().isUnitTestMode) Mode.ALWAYS_SMART else Mode.PLAIN_WHEN_NEEDED @get:TestOnly - var testLog: MutableList? = null + var testLog: MutableCollection? = null inline fun testLog(s: () -> String) { testLog?.add(s()) diff --git a/idea/src/org/jetbrains/kotlin/idea/findUsages/handlers/KotlinFindMemberUsagesHandler.kt b/idea/src/org/jetbrains/kotlin/idea/findUsages/handlers/KotlinFindMemberUsagesHandler.kt index c3b7733433f..ffbe09c5d24 100644 --- a/idea/src/org/jetbrains/kotlin/idea/findUsages/handlers/KotlinFindMemberUsagesHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/findUsages/handlers/KotlinFindMemberUsagesHandler.kt @@ -238,7 +238,7 @@ abstract class KotlinFindMemberUsagesHandler protected c if (element is KtElement && !isOnlyKotlinSearch(options.searchScope)) { // TODO: very bad code!! ReferencesSearch does not work correctly for constructors and annotation parameters val psiMethodScopeSearch = when { - element is KtNamedFunction || element is KtParameter && element.dataClassComponentFunction() != null -> + element is KtParameter && element.dataClassComponentFunction() != null -> options.searchScope.excludeKotlinSources() else -> options.searchScope } diff --git a/idea/testData/findUsages/java/findJavaMethodUsages/JavaWithGroovyInvoke.log b/idea/testData/findUsages/java/findJavaMethodUsages/JavaWithGroovyInvoke.log index 73fa9590ea7..6c75e4c8c01 100644 --- a/idea/testData/findUsages/java/findJavaMethodUsages/JavaWithGroovyInvoke.log +++ b/idea/testData/findUsages/java/findJavaMethodUsages/JavaWithGroovyInvoke.log @@ -2,10 +2,8 @@ Resolved c() Resolved fieldWithType() Resolved methodWithType() Resolved o() -Resolved o() Resolved o.methodNoType()() Resolved o.methodWithType()() -Resolved o.methodWithType()() Searched references to GroovyClass Searched references to GroovyClass.fieldWithType in non-Java files Searched references to GroovyClass.methodWithType() in non-Java files diff --git a/idea/testData/findUsages/java/findJavaMethodUsages/javaInvoke.log b/idea/testData/findUsages/java/findJavaMethodUsages/javaInvoke.log index d83063f3690..b7430245914 100644 --- a/idea/testData/findUsages/java/findJavaMethodUsages/javaInvoke.log +++ b/idea/testData/findUsages/java/findJavaMethodUsages/javaInvoke.log @@ -1,8 +1,4 @@ Resolved INSTANCE() -Resolved INSTANCE() -Resolved INSTANCE() -Resolved INSTANCE() -Resolved OJC() Resolved OJC() Resolved c() Resolved o() diff --git a/idea/testData/findUsages/java/findJavaMethodUsages/javaInvokeWithStaticImport.log b/idea/testData/findUsages/java/findJavaMethodUsages/javaInvokeWithStaticImport.log index 7d032e524ba..4ebcd8b3867 100644 --- a/idea/testData/findUsages/java/findJavaMethodUsages/javaInvokeWithStaticImport.log +++ b/idea/testData/findUsages/java/findJavaMethodUsages/javaInvokeWithStaticImport.log @@ -1,5 +1,4 @@ Resolved INSTANCE() -Resolved INSTANCE() Searched imported static member PsiField:INSTANCE in [KtFile: javaInvokeWithStaticImport.0.kt] Searched imported static member PsiField:INSTANCE in [KtFile: javaInvokeWithStaticImport.1.kt] Searched references to JavaClassWI diff --git a/idea/testData/findUsages/kotlin/companionObject/inContainingClass.0.kt b/idea/testData/findUsages/kotlin/companionObject/inContainingClass.0.kt index 535afd74f3c..379bbb0caaa 100644 --- a/idea/testData/findUsages/kotlin/companionObject/inContainingClass.0.kt +++ b/idea/testData/findUsages/kotlin/companionObject/inContainingClass.0.kt @@ -23,4 +23,6 @@ class A() { interface Foo fun Foo.ext() { -} \ No newline at end of file +} + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/conventions/components/companionObjectAccess.0.kt b/idea/testData/findUsages/kotlin/conventions/components/companionObjectAccess.0.kt index d4747ce8919..83e525f7701 100644 --- a/idea/testData/findUsages/kotlin/conventions/components/companionObjectAccess.0.kt +++ b/idea/testData/findUsages/kotlin/conventions/components/companionObjectAccess.0.kt @@ -11,4 +11,6 @@ data class B(val x: Int, val y: Int) fun foo() { val (x, y) = A.b() -} \ No newline at end of file +} + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/conventions/components/dataClass.log b/idea/testData/findUsages/kotlin/conventions/components/dataClass.log index d1396662f2e..4b0d1736bb4 100644 --- a/idea/testData/findUsages/kotlin/conventions/components/dataClass.log +++ b/idea/testData/findUsages/kotlin/conventions/components/dataClass.log @@ -2,24 +2,15 @@ Checked type of a Checked type of g() Checked type of h() Checked type of listOfA() -Checked type of listOfA() Checked type of x Checked type of x1 -Checked type of x1 Checked type of x2 -Checked type of x2 -Checked type of x3 -Checked type of x3 Checked type of x3 Checked type of x4 Checked type of x5 Checked type of y Checked type of y1 -Checked type of y1 Checked type of y2 -Checked type of y2 -Checked type of y3 -Checked type of y3 Checked type of y3 Checked type of y4 Checked type of y5 @@ -35,7 +26,6 @@ Resolved (x1, y1, z1) Resolved (x2, y2) Resolved (x2, y2, z2) Resolved (x3, y3) -Resolved (x3, y3) Resolved (x3, y3, z3) Resolved (x4, y4, z4) Resolved (x5, y5, z5) diff --git a/idea/testData/findUsages/kotlin/conventions/components/for.log b/idea/testData/findUsages/kotlin/conventions/components/for.log index e69848c47ad..7bb33a48352 100644 --- a/idea/testData/findUsages/kotlin/conventions/components/for.log +++ b/idea/testData/findUsages/kotlin/conventions/components/for.log @@ -1,7 +1,5 @@ Checked type of parameter a of FOR Checked type of x -Checked type of x -Checked type of y Checked type of y Checked type of z Resolved (x, y) diff --git a/idea/testData/findUsages/kotlin/conventions/components/isAndAs.0.kt b/idea/testData/findUsages/kotlin/conventions/components/isAndAs.0.kt index bdf9e4970e7..da93535cc5c 100644 --- a/idea/testData/findUsages/kotlin/conventions/components/isAndAs.0.kt +++ b/idea/testData/findUsages/kotlin/conventions/components/isAndAs.0.kt @@ -14,3 +14,4 @@ fun y(o: Any) { val list = o as List val (x, y) = list[0] } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/conventions/components/operators.log b/idea/testData/findUsages/kotlin/conventions/components/operators.log index 1c9e42f39b1..c526265aca0 100644 --- a/idea/testData/findUsages/kotlin/conventions/components/operators.log +++ b/idea/testData/findUsages/kotlin/conventions/components/operators.log @@ -1,8 +1,4 @@ Checked type of x -Checked type of x -Checked type of x -Checked type of y -Checked type of y Checked type of y Resolved (x, y) Resolved b1 + b2 diff --git a/idea/testData/findUsages/kotlin/conventions/components/recursiveDataClass1.log b/idea/testData/findUsages/kotlin/conventions/components/recursiveDataClass1.log index 3aaa9783f9d..355d9e11c10 100644 --- a/idea/testData/findUsages/kotlin/conventions/components/recursiveDataClass1.log +++ b/idea/testData/findUsages/kotlin/conventions/components/recursiveDataClass1.log @@ -1,15 +1,12 @@ Checked type of a1 Checked type of a2 -Checked type of a2 Checked type of n1 Checked type of n2 -Checked type of n2 ExpressionOfTypeProcessor is already started for A. Exit for operator parameter a of A(val a: A?, val n: Int). Resolved (a1, n1) Resolved (a2, n2) -Resolved (a2, n2) Searched references to A Searched references to parameter a of A(val a: A?, val n: Int) in non-Java files Searched references to parameter a of f(a: A) in non-Java files Used plain search of parameter a of A(val a: A?, val n: Int) in LocalSearchScope: - CLASS:A + CLASS:A \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/conventions/contains.log b/idea/testData/findUsages/kotlin/conventions/contains.log index ef71e737adc..6661d358de3 100644 --- a/idea/testData/findUsages/kotlin/conventions/contains.log +++ b/idea/testData/findUsages/kotlin/conventions/contains.log @@ -1,7 +1,5 @@ Resolved !in -Resolved !in -Resolved in Resolved in Searched references to A Used plain search of A.contains(k: Int) in LocalSearchScope: - CLASS:A + CLASS:A \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/conventions/forIteration.log b/idea/testData/findUsages/kotlin/conventions/forIteration.log index d334804dece..8ccc9c8e32f 100644 --- a/idea/testData/findUsages/kotlin/conventions/forIteration.log +++ b/idea/testData/findUsages/kotlin/conventions/forIteration.log @@ -1,7 +1,6 @@ Checked type of parameter a of FOR -Checked type of parameter a of FOR Resolved for (a in A()) {} Resolved for (a in A()) {} Searched references to A Used plain search of A.iterator() in LocalSearchScope: - CLASS:A + CLASS:A \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/conventions/get.0.kt b/idea/testData/findUsages/kotlin/conventions/get.0.kt index b89b2cf5ed4..f33750a4285 100644 --- a/idea/testData/findUsages/kotlin/conventions/get.0.kt +++ b/idea/testData/findUsages/kotlin/conventions/get.0.kt @@ -12,3 +12,5 @@ fun test() { val b = B(2) b[3] = "a" } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/conventions/plus.0.kt b/idea/testData/findUsages/kotlin/conventions/plus.0.kt index 634625d9fef..72138881877 100644 --- a/idea/testData/findUsages/kotlin/conventions/plus.0.kt +++ b/idea/testData/findUsages/kotlin/conventions/plus.0.kt @@ -20,3 +20,5 @@ fun test(array: Array) { val (a1, a2) = array a1 + 1 } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/conventions/plus.log b/idea/testData/findUsages/kotlin/conventions/plus.log index 39889f1322a..6798bb36c27 100644 --- a/idea/testData/findUsages/kotlin/conventions/plus.log +++ b/idea/testData/findUsages/kotlin/conventions/plus.log @@ -5,7 +5,6 @@ ExpressionOfTypeProcessor is already started for A. Exit for operator A.plus(a: ExpressionOfTypeProcessor is already started for A. Exit for operator A.plus(m: Int). Resolved A(0) + A(1) Resolved A(0) + A(1) + 2 -Resolved A(0) + A(1) + 2 Resolved a += 1 Resolved a += A(1) Resolved a1 + 1 diff --git a/idea/testData/findUsages/kotlin/conventions/set.0.kt b/idea/testData/findUsages/kotlin/conventions/set.0.kt index 166e584b143..cec17f31a7b 100644 --- a/idea/testData/findUsages/kotlin/conventions/set.0.kt +++ b/idea/testData/findUsages/kotlin/conventions/set.0.kt @@ -13,3 +13,5 @@ fun test() { a[2]++ a[3] } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/conventions/severalOperators.log b/idea/testData/findUsages/kotlin/conventions/severalOperators.log index d306798b8aa..4beaf9397c3 100644 --- a/idea/testData/findUsages/kotlin/conventions/severalOperators.log +++ b/idea/testData/findUsages/kotlin/conventions/severalOperators.log @@ -1,24 +1,15 @@ Checked type of a -Checked type of a -Checked type of b Checked type of b Checked type of c -Checked type of c -Checked type of d Checked type of d Checked type of dInT2 Checked type of dInT3 Checked type of div(other: A) Checked type of indirectDiction() -Checked type of indirectDiction() -Checked type of indirectDiction() Checked type of indirectPlusDiction() -Checked type of indirectPlusDiction() -Checked type of t Checked type of t Checked type of times(other: Diction) Checked type of tt -Checked type of tt ExpressionOfTypeProcessor is already started for Diction. Exit for operator Diction.minus(other: Diction). ExpressionOfTypeProcessor is already started for Diction. Exit for operator Diction.plus(other: Diction). ExpressionOfTypeProcessor is already started for Diction. Exit for operator times(other: Diction). diff --git a/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedClassUsages1.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedClassUsages1.0.kt index 19d7eabeb08..a1ae90b3505 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedClassUsages1.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedClassUsages1.0.kt @@ -15,3 +15,5 @@ open class C: Y { interface Z: A { } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedClassUsages2.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedClassUsages2.0.kt index 00585d9352c..ddc6a3a7895 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedClassUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedClassUsages2.0.kt @@ -15,3 +15,5 @@ open class C: Y { interface Z: A { } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedInterfaceUsages1.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedInterfaceUsages1.0.kt index 46d317d8345..329ec83922a 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedInterfaceUsages1.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedInterfaceUsages1.0.kt @@ -15,3 +15,4 @@ open class C: Y { interface Z: A { } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedInterfaceUsages2.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedInterfaceUsages2.0.kt index 65c66b43c3a..7535b180c71 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedInterfaceUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/javaDerivedInterfaceUsages2.0.kt @@ -15,3 +15,4 @@ open class C: Y { interface Z: A { } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassAllUsages3.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassAllUsages3.0.kt index c84f9bb1104..9fe85fab996 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassAllUsages3.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassAllUsages3.0.kt @@ -3,3 +3,4 @@ package server data class Data +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassConstructorUsages.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassConstructorUsages.0.kt index ee3dbc26df3..554239d8ffb 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassConstructorUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassConstructorUsages.0.kt @@ -15,3 +15,5 @@ open class Server { println("Server") } } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassImportAliasAllUsages.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassImportAliasAllUsages.0.kt index 7c9b9e82b93..b62761a4663 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassImportAliasAllUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/kotlinClassImportAliasAllUsages.0.kt @@ -54,4 +54,6 @@ fun Any.asServer(): Server? { is Server -> println("Server!") } return if (this is Server) this as Server else this as? Server -} \ No newline at end of file +} + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedAnonymousObjects.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedAnonymousObjects.0.kt index fd6a082d9c2..6d086a3ef0c 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedAnonymousObjects.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedAnonymousObjects.0.kt @@ -14,3 +14,4 @@ fun foo() { } } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalClasses.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalClasses.0.kt index cd0b6cad5f3..7f58abd7602 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalClasses.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalClasses.0.kt @@ -14,3 +14,4 @@ fun foo() { } } +// DISABLE-ERRORS diff --git a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalObjects.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalObjects.0.kt index fe40cd43a8a..8a38500969d 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalObjects.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalObjects.0.kt @@ -14,3 +14,4 @@ fun foo() { } } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalTraits.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalTraits.0.kt index 4ded0be28ad..257a823c5c7 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalTraits.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassDerivedLocalTraits.0.kt @@ -10,3 +10,4 @@ fun foo() { } } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassUsages1.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassUsages1.0.kt index db92bf049db..9c92a39e260 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassUsages1.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassUsages1.0.kt @@ -7,3 +7,5 @@ fun foo(): Any { } val x = Bar() + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassUsages2.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassUsages2.0.kt index 26fc321206e..17b07f01aa9 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/kotlinLocalClassUsages2.0.kt @@ -11,3 +11,5 @@ fun foo(): Any { } val x = Bar() + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findClassUsages/kotlinPrivateClassUsages.0.kt b/idea/testData/findUsages/kotlin/findClassUsages/kotlinPrivateClassUsages.0.kt index b407a59087e..cb0e5e9ee17 100644 --- a/idea/testData/findUsages/kotlin/findClassUsages/kotlinPrivateClassUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findClassUsages/kotlinPrivateClassUsages.0.kt @@ -14,3 +14,4 @@ public class ServerEx(): Server() { override fun processRequest() = Server.Foo() } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.0.kt b/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.0.kt index e59a4e1652f..a9e677900c1 100644 --- a/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/enumFunctionUsages.0.kt @@ -23,3 +23,5 @@ enum class E { open fun foo(n: Int): Int = n } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/highlightingOfSuperUsages.0.kt b/idea/testData/findUsages/kotlin/findFunctionUsages/highlightingOfSuperUsages.0.kt index bc074b24a71..aed2d7fd1c8 100644 --- a/idea/testData/findUsages/kotlin/findFunctionUsages/highlightingOfSuperUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/highlightingOfSuperUsages.0.kt @@ -16,3 +16,5 @@ fun test(i: I) { A().foo() B().foo() } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinLocalMethodUsages2.0.kt b/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinLocalMethodUsages2.0.kt index 7e3b437913a..48a0f547341 100644 --- a/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinLocalMethodUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinLocalMethodUsages2.0.kt @@ -13,3 +13,5 @@ fun foo() { } bar() + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinMultiRefInImport.0.kt b/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinMultiRefInImport.0.kt index 53f32c47b6e..a498d28a5be 100644 --- a/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinMultiRefInImport.0.kt +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinMultiRefInImport.0.kt @@ -15,3 +15,4 @@ fun foo(n: Int) { } val foo: Int +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinOverloadAndExtensionUsages.0.kt b/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinOverloadAndExtensionUsages.0.kt index 5b3f948f010..a7963f85d91 100644 --- a/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinOverloadAndExtensionUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinOverloadAndExtensionUsages.0.kt @@ -43,3 +43,5 @@ fun B.foo(s: String, n: Number) { fun bar(b: B) { b.foo("", 0) } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinOverloadAndExtensionUsages2.0.kt b/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinOverloadAndExtensionUsages2.0.kt index 49589960700..a172b22804e 100644 --- a/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinOverloadAndExtensionUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinOverloadAndExtensionUsages2.0.kt @@ -21,3 +21,4 @@ fun A.foo(s: String) { fun X.foo(n: Int) { } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinPrivateMethodUsages.0.kt b/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinPrivateMethodUsages.0.kt index cd8880b5850..6fc889dad19 100644 --- a/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinPrivateMethodUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/kotlinPrivateMethodUsages.0.kt @@ -11,4 +11,5 @@ public open class Server() { public class ServerEx(): Server() { override fun processRequest() = "foo" + doProcessRequest() } +// DISABLE-ERRORS diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.0.kt b/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.0.kt new file mode 100644 index 00000000000..90531a8d02b --- /dev/null +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.0.kt @@ -0,0 +1,9 @@ +// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtNamedFunction +// CHECK_SUPER_METHODS_YES_NO_DIALOG: no +// OPTIONS: usages + +class SomeXImpl: SomeX { + override fun getSmth(): String = TODO() +} + +fun foo(x: SomeXImpl) = x.smth \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.1.java b/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.1.java new file mode 100644 index 00000000000..7271df390c7 --- /dev/null +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.1.java @@ -0,0 +1,4 @@ + +public interface SomeX { + String getSmth(); +} diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.log b/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.log new file mode 100644 index 00000000000..8b137891791 --- /dev/null +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.log @@ -0,0 +1 @@ + diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.results.txt b/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.results.txt new file mode 100644 index 00000000000..7d64ab5c075 --- /dev/null +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.results.txt @@ -0,0 +1 @@ +Value read 9 fun foo(x: SomeXImpl) = x.smth \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findFunctionUsages/synthesizedFunction.0.kt b/idea/testData/findUsages/kotlin/findFunctionUsages/synthesizedFunction.0.kt index 6a302c48677..83fd4a75575 100644 --- a/idea/testData/findUsages/kotlin/findFunctionUsages/synthesizedFunction.0.kt +++ b/idea/testData/findUsages/kotlin/findFunctionUsages/synthesizedFunction.0.kt @@ -11,3 +11,5 @@ fun main(a: A) { a.copy(1) B(0).copy(1) } + +// DISABLE-ERRORS diff --git a/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesK.0.kt b/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesK.0.kt index f904b9fa6a7..e340f106a7b 100644 --- a/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesK.0.kt +++ b/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesK.0.kt @@ -24,4 +24,6 @@ fun test() { val t = B().p B().p = 1 -} \ No newline at end of file +} + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesKJK.0.kt b/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesKJK.0.kt index 4900180e099..7a887986a92 100644 --- a/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesKJK.0.kt +++ b/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesKJK.0.kt @@ -25,4 +25,6 @@ fun test() { val t = B().p B().p = 1 -} \ No newline at end of file +} + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesKK.0.kt b/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesKK.0.kt index 1e730dea7a4..6241e9be9f5 100644 --- a/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesKK.0.kt +++ b/idea/testData/findUsages/kotlin/findJavaPropertyUsages/javaPropertyUsagesKK.0.kt @@ -25,4 +25,6 @@ fun test() { val t = B().p B().p = 1 -} \ No newline at end of file +} + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findObjectUsages/kotlinLocalObjectUsages1.0.kt b/idea/testData/findUsages/kotlin/findObjectUsages/kotlinLocalObjectUsages1.0.kt index d6d29907f4e..47dd973c842 100644 --- a/idea/testData/findUsages/kotlin/findObjectUsages/kotlinLocalObjectUsages1.0.kt +++ b/idea/testData/findUsages/kotlin/findObjectUsages/kotlinLocalObjectUsages1.0.kt @@ -7,3 +7,5 @@ fun foo(): Any { } val x = Bar + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findObjectUsages/kotlinLocalObjectUsages2.0.kt b/idea/testData/findUsages/kotlin/findObjectUsages/kotlinLocalObjectUsages2.0.kt index 0eb0af88178..fdd8e151710 100644 --- a/idea/testData/findUsages/kotlin/findObjectUsages/kotlinLocalObjectUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findObjectUsages/kotlinLocalObjectUsages2.0.kt @@ -11,3 +11,4 @@ fun foo(): Any { } val x = Bar +// DISABLE-ERRORS diff --git a/idea/testData/findUsages/kotlin/findObjectUsages/kotlinPrivateObjectUsages.0.kt b/idea/testData/findUsages/kotlin/findObjectUsages/kotlinPrivateObjectUsages.0.kt index d72e986ea3c..cf9f5683d91 100644 --- a/idea/testData/findUsages/kotlin/findObjectUsages/kotlinPrivateObjectUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findObjectUsages/kotlinPrivateObjectUsages.0.kt @@ -14,3 +14,4 @@ public class ServerEx(): Server() { override fun processRequest() = Server.Foo } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findParameterUsages/kotlinConstructorParameterUsages.0.kt b/idea/testData/findUsages/kotlin/findParameterUsages/kotlinConstructorParameterUsages.0.kt index df622db6271..6f96bd6f9d9 100644 --- a/idea/testData/findUsages/kotlin/findParameterUsages/kotlinConstructorParameterUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findParameterUsages/kotlinConstructorParameterUsages.0.kt @@ -14,4 +14,6 @@ open class A(foo: T) { fun usage() { A(foo = ":)") -} \ No newline at end of file +} + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinLocalPropertyUsages1.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinLocalPropertyUsages1.0.kt index fd8d54d5cd8..99455f5fbca 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinLocalPropertyUsages1.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinLocalPropertyUsages1.0.kt @@ -7,3 +7,5 @@ fun foo(): String { } val x = bar + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinLocalPropertyUsages2.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinLocalPropertyUsages2.0.kt index acb44125ed6..6e01f82cf42 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinLocalPropertyUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinLocalPropertyUsages2.0.kt @@ -11,3 +11,4 @@ fun foo(): String { } val x = bar +// DISABLE-ERRORS diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinMultiRefInImport.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinMultiRefInImport.0.kt index 4c33d830331..63a084968cf 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinMultiRefInImport.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinMultiRefInImport.0.kt @@ -9,3 +9,4 @@ fun foo() { val foo: Int = 1 val Int.foo: Int = 2 +// DISABLE-ERRORS diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPrivatePropertyUsages.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPrivatePropertyUsages.0.kt index d843e421ecc..c097b1c4c8d 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPrivatePropertyUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPrivatePropertyUsages.0.kt @@ -11,4 +11,5 @@ public open class Server() { public class ServerEx(): Server() { override fun processRequest() = "foo" + foo } +// DISABLE-ERRORS diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPrivatePropertyUsages2.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPrivatePropertyUsages2.0.kt index 1a048ee0c96..0440d2fda0b 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPrivatePropertyUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPrivatePropertyUsages2.0.kt @@ -10,4 +10,5 @@ public class ServerEx(): Server(foo = "!") { override fun processRequest() = "foo" + foo // this reference is found as a side effect of big use scope of constructor parameter: // if it was simple property, it wouldn't be found } +// DISABLE-ERRORS diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyReadUsages.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyReadUsages.0.kt index e785bd898e1..ba459fbf2c0 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyReadUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyReadUsages.0.kt @@ -17,3 +17,4 @@ open class B: A() { super.foo = value } } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyReadUsages2.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyReadUsages2.0.kt index c24fe77c808..eb59ba4a65d 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyReadUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyReadUsages2.0.kt @@ -15,3 +15,5 @@ open class B: A() { super.foo = value } } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyUsages.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyUsages.0.kt index 71050231b1c..a2be0ed3a53 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyUsages.0.kt @@ -17,3 +17,5 @@ open class B: A() { super.foo = value } } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyUsages2.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyUsages2.0.kt index b29fa87bc49..04c8a21ec7e 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyUsages2.0.kt @@ -15,3 +15,5 @@ open class B: A() { super.foo = value } } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyWriteUsages.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyWriteUsages.0.kt index cf7be06c41f..d53b8c00982 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyWriteUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyWriteUsages.0.kt @@ -17,3 +17,4 @@ open class B: A() { super.foo = value } } +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyWriteUsages2.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyWriteUsages2.0.kt index b1bf6979c06..02183528b79 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyWriteUsages2.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kotlinPropertyWriteUsages2.0.kt @@ -15,3 +15,5 @@ open class B: A() { super.foo = value } } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findPropertyUsages/kt7656.0.kt b/idea/testData/findUsages/kotlin/findPropertyUsages/kt7656.0.kt index f05125455bb..c8a5061968f 100644 --- a/idea/testData/findUsages/kotlin/findPropertyUsages/kt7656.0.kt +++ b/idea/testData/findUsages/kotlin/findPropertyUsages/kt7656.0.kt @@ -8,4 +8,5 @@ fun main(args: Array) { val a = A(10) println(a.field) -} \ No newline at end of file +} +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findTypeParameterUsages/propertyWithTypeParameter.0.kt b/idea/testData/findUsages/kotlin/findTypeParameterUsages/propertyWithTypeParameter.0.kt index 1b09848820c..c16e0f61ee6 100644 --- a/idea/testData/findUsages/kotlin/findTypeParameterUsages/propertyWithTypeParameter.0.kt +++ b/idea/testData/findUsages/kotlin/findTypeParameterUsages/propertyWithTypeParameter.0.kt @@ -1,2 +1,4 @@ // PSI_ELEMENT: org.jetbrains.kotlin.psi.KtTypeParameter -val > foo: T \ No newline at end of file +val > foo: T + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findWithStructuralGrouping/kotlinPropertyUsages.0.kt b/idea/testData/findUsages/kotlin/findWithStructuralGrouping/kotlinPropertyUsages.0.kt index e61380afa41..37e0000d3fc 100644 --- a/idea/testData/findUsages/kotlin/findWithStructuralGrouping/kotlinPropertyUsages.0.kt +++ b/idea/testData/findUsages/kotlin/findWithStructuralGrouping/kotlinPropertyUsages.0.kt @@ -18,3 +18,5 @@ open class B: A() { super.foo = value } } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/internal/findFunctionUsages/enumFunctionUsages.0.kt b/idea/testData/findUsages/kotlin/internal/findFunctionUsages/enumFunctionUsages.0.kt index 5df70d53ae6..4ded1e86f33 100644 --- a/idea/testData/findUsages/kotlin/internal/findFunctionUsages/enumFunctionUsages.0.kt +++ b/idea/testData/findUsages/kotlin/internal/findFunctionUsages/enumFunctionUsages.0.kt @@ -23,3 +23,5 @@ enum class E { internal open fun foo(n: Int): Int = n } + +// DISABLE-ERRORS \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/internal/findFunctionUsages/kotlinMultiRefInImport.0.kt b/idea/testData/findUsages/kotlin/internal/findFunctionUsages/kotlinMultiRefInImport.0.kt index 42c9328e59c..b65254af495 100644 --- a/idea/testData/findUsages/kotlin/internal/findFunctionUsages/kotlinMultiRefInImport.0.kt +++ b/idea/testData/findUsages/kotlin/internal/findFunctionUsages/kotlinMultiRefInImport.0.kt @@ -15,3 +15,5 @@ fun foo(n: Int) { } val foo: Int + +// ERROR: Property must be initialized diff --git a/idea/testData/findUsages/kotlin/internal/findFunctionUsages/kotlinTraitImplThroughDelegate.0.kt b/idea/testData/findUsages/kotlin/internal/findFunctionUsages/kotlinTraitImplThroughDelegate.0.kt index 45e276c6396..196aaf9c719 100644 --- a/idea/testData/findUsages/kotlin/internal/findFunctionUsages/kotlinTraitImplThroughDelegate.0.kt +++ b/idea/testData/findUsages/kotlin/internal/findFunctionUsages/kotlinTraitImplThroughDelegate.0.kt @@ -8,4 +8,6 @@ interface TraitWithImpl { public class TraitWithDelegatedWithImpl(f: TraitWithImpl): TraitWithImpl by f -fun test(twdwi: TraitWithDelegatedWithImpl) = twdwi.foo() \ No newline at end of file +fun test(twdwi: TraitWithDelegatedWithImpl) = twdwi.foo() + +// ERROR: Modifier 'internal' is not applicable inside 'interface' \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/internal/findFunctionUsages/usagesOfBaseForFunction.0.kt b/idea/testData/findUsages/kotlin/internal/findFunctionUsages/usagesOfBaseForFunction.0.kt index dbc42b91218..461c8313de6 100644 --- a/idea/testData/findUsages/kotlin/internal/findFunctionUsages/usagesOfBaseForFunction.0.kt +++ b/idea/testData/findUsages/kotlin/internal/findFunctionUsages/usagesOfBaseForFunction.0.kt @@ -14,3 +14,4 @@ fun main(a: A) { } // for KT-3769 Find usages gives no result for overrides +// ERROR: Modifier 'internal' is not applicable inside 'interface' \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/internal/findPropertyUsages/kotlinMultiRefInImport.0.kt b/idea/testData/findUsages/kotlin/internal/findPropertyUsages/kotlinMultiRefInImport.0.kt index 7e967c34165..8a8f4e696fb 100644 --- a/idea/testData/findUsages/kotlin/internal/findPropertyUsages/kotlinMultiRefInImport.0.kt +++ b/idea/testData/findUsages/kotlin/internal/findPropertyUsages/kotlinMultiRefInImport.0.kt @@ -9,3 +9,5 @@ fun foo() { internal val foo: Int = 1 val Int.foo: Int = 2 + +// ERROR: Extension property cannot be initialized because it has no backing field \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/internal/findPropertyUsages/kotlinPropertyUsages.0.kt b/idea/testData/findUsages/kotlin/internal/findPropertyUsages/kotlinPropertyUsages.0.kt index 17a2b5a0ce1..265971937d3 100644 --- a/idea/testData/findUsages/kotlin/internal/findPropertyUsages/kotlinPropertyUsages.0.kt +++ b/idea/testData/findUsages/kotlin/internal/findPropertyUsages/kotlinPropertyUsages.0.kt @@ -17,3 +17,5 @@ open class B: A() { super.foo = value } } + +// DISABLE-ERRORS diff --git a/idea/testData/findUsages/kotlin/script/anonymousObject.0.kts b/idea/testData/findUsages/kotlin/script/anonymousObject.0.kts index 64983590751..d7faa158825 100644 --- a/idea/testData/findUsages/kotlin/script/anonymousObject.0.kts +++ b/idea/testData/findUsages/kotlin/script/anonymousObject.0.kts @@ -2,4 +2,6 @@ // OPTIONS: usages object: Any() { -} \ No newline at end of file +} + +// ERROR: No script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies. \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/script/anonymousObjectAsInitializer.0.kts b/idea/testData/findUsages/kotlin/script/anonymousObjectAsInitializer.0.kts index bce680e98ba..594eb3bb152 100644 --- a/idea/testData/findUsages/kotlin/script/anonymousObjectAsInitializer.0.kts +++ b/idea/testData/findUsages/kotlin/script/anonymousObjectAsInitializer.0.kts @@ -2,4 +2,6 @@ // OPTIONS: usages val x = object: Any() { -} \ No newline at end of file +} + +// ERROR: No script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies. \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/script/anonymousObjectInFun.0.kts b/idea/testData/findUsages/kotlin/script/anonymousObjectInFun.0.kts index 12317e91cae..b99835ba96e 100644 --- a/idea/testData/findUsages/kotlin/script/anonymousObjectInFun.0.kts +++ b/idea/testData/findUsages/kotlin/script/anonymousObjectInFun.0.kts @@ -3,3 +3,5 @@ fun foo() { val x = object : Any() {} } + +// ERROR: No script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies. \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/script/dummy.0.kts b/idea/testData/findUsages/kotlin/script/dummy.0.kts index 8b7a3c9abe3..78406e8aaae 100644 --- a/idea/testData/findUsages/kotlin/script/dummy.0.kts +++ b/idea/testData/findUsages/kotlin/script/dummy.0.kts @@ -2,3 +2,5 @@ // OPTIONS: usages val foo = "foo" val bar = foo + +// ERROR: No script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies. \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/script/localClass.0.kts b/idea/testData/findUsages/kotlin/script/localClass.0.kts index a93a65a8d90..a8452fb3953 100644 --- a/idea/testData/findUsages/kotlin/script/localClass.0.kts +++ b/idea/testData/findUsages/kotlin/script/localClass.0.kts @@ -5,3 +5,5 @@ fun foo() { val x = Local() } + +// ERROR: No script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies. \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/variable/plusAssignFun.0.kt b/idea/testData/findUsages/kotlin/variable/plusAssignFun.0.kt index ee5b9fd112b..9ee107c545d 100644 --- a/idea/testData/findUsages/kotlin/variable/plusAssignFun.0.kt +++ b/idea/testData/findUsages/kotlin/variable/plusAssignFun.0.kt @@ -8,3 +8,6 @@ fun foo() { val c = C() c += 10 } + +// ERROR: 'operator' modifier is inapplicable on this function: must return Unit +// ERROR: Function 'plusAssign' should return Unit to be used by corresponding operator '+=' diff --git a/idea/testData/findUsages/kotlin/variable/readAccess.0.kt b/idea/testData/findUsages/kotlin/variable/readAccess.0.kt index 6b288d27bc2..36a12f3d8c1 100644 --- a/idea/testData/findUsages/kotlin/variable/readAccess.0.kt +++ b/idea/testData/findUsages/kotlin/variable/readAccess.0.kt @@ -11,3 +11,5 @@ fun foo() { v += 1 (v) -= 1 } + +// ERROR: Unresolved reference: X diff --git a/idea/testData/findUsages/kotlin/variable/writeAccess.0.kt b/idea/testData/findUsages/kotlin/variable/writeAccess.0.kt index c8209819772..001c2fdb21d 100644 --- a/idea/testData/findUsages/kotlin/variable/writeAccess.0.kt +++ b/idea/testData/findUsages/kotlin/variable/writeAccess.0.kt @@ -11,3 +11,5 @@ fun foo() { v += 1 (v) -= 1 } +// ERROR: This annotation is not applicable to target 'expression' +// ERROR: Unresolved reference: X diff --git a/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryFieldUsages.0.kt b/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryFieldUsages.0.kt index 6976c72f44c..99e7e9a49b9 100644 --- a/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryFieldUsages.0.kt +++ b/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryFieldUsages.0.kt @@ -6,5 +6,5 @@ package usages import library.Foo fun test() { - Foo().x = 1 + Foo(1).x = 1 } \ No newline at end of file diff --git a/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryFieldUsages.results.txt b/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryFieldUsages.results.txt index 211a479f821..205c126532d 100644 --- a/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryFieldUsages.results.txt +++ b/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryFieldUsages.results.txt @@ -1 +1 @@ -Value write 9 Foo().x = 1 +Value write 9 Foo(1).x = 1 diff --git a/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryMethodUsages.0.kt b/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryMethodUsages.0.kt index d5e8fb1de19..b7343ac206e 100644 --- a/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryMethodUsages.0.kt +++ b/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryMethodUsages.0.kt @@ -6,5 +6,5 @@ package usages import library.Foo fun test() { - Foo().bar(1) + Foo(1).bar(1) } \ No newline at end of file diff --git a/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryMethodUsages.results.txt b/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryMethodUsages.results.txt index 646567115b7..66de016a97c 100644 --- a/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryMethodUsages.results.txt +++ b/idea/testData/findUsages/libraryUsages/javaLibrary/LibraryMethodUsages.results.txt @@ -1 +1 @@ -Function call 9 Foo().bar(1) +Function call 9 Foo(1).bar(1) diff --git a/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt b/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt index 77a025cf64f..1132d777e66 100644 --- a/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt +++ b/idea/tests/org/jetbrains/kotlin/findUsages/AbstractFindUsagesTest.kt @@ -38,12 +38,14 @@ import com.intellij.usages.impl.rules.UsageTypeProvider import com.intellij.usages.rules.UsageFilteringRule import com.intellij.usages.rules.UsageGroupingRule import com.intellij.util.CommonProcessors +import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithAllCompilerChecks import org.jetbrains.kotlin.idea.core.script.ScriptConfigurationManager import org.jetbrains.kotlin.idea.core.util.clearDialogsResults import org.jetbrains.kotlin.idea.core.util.setDialogsResult import org.jetbrains.kotlin.idea.findUsages.handlers.KotlinFindMemberUsagesHandler import org.jetbrains.kotlin.idea.refactoring.CHECK_SUPER_METHODS_YES_NO_DIALOG import org.jetbrains.kotlin.idea.search.usagesSearch.ExpressionsOfTypeProcessor +import org.jetbrains.kotlin.idea.test.DirectiveBasedActionUtils import org.jetbrains.kotlin.idea.test.KotlinLightCodeInsightFixtureTestCase import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor import org.jetbrains.kotlin.idea.test.TestFixtureExtension @@ -51,10 +53,12 @@ import org.jetbrains.kotlin.idea.util.ProjectRootsUtil import org.jetbrains.kotlin.idea.util.runReadActionInSmartMode import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType +import org.jetbrains.kotlin.resolve.diagnostics.Diagnostics import org.jetbrains.kotlin.test.InTextDirectivesUtils import org.jetbrains.kotlin.test.KotlinTestUtils import java.io.File import java.util.* +import kotlin.collections.LinkedHashSet abstract class AbstractFindUsagesWithDisableComponentSearchTest : AbstractFindUsagesTest() { @@ -135,6 +139,12 @@ abstract class AbstractFindUsagesTest : KotlinLightCodeInsightFixtureTestCase() ScriptConfigurationManager.updateScriptDependenciesSynchronously(myFixture.file) } + (myFixture.file as? KtFile)?.let { ktFile -> + val diagnosticsProvider: (KtFile) -> Diagnostics = { it.analyzeWithAllCompilerChecks().bindingContext.diagnostics } + DirectiveBasedActionUtils.checkForUnexpectedWarnings(ktFile, diagnosticsProvider) + DirectiveBasedActionUtils.checkForUnexpectedErrors(ktFile, diagnosticsProvider) + } + val caretElement = when { InTextDirectivesUtils.isDirectiveDefined(mainFileText, "// FIND_BY_REF") -> TargetElementUtil.findTargetElement( myFixture.editor, @@ -226,7 +236,7 @@ internal fun findUsagesAndCheckResults( val highlightingMode = InTextDirectivesUtils.isDirectiveDefined(mainFileText, "// HIGHLIGHTING") var log: String? = null - val logList = ArrayList() + val logList = LinkedHashSet() val usageInfos = try { if (ExpressionsOfTypeProcessor.mode !== ExpressionsOfTypeProcessor.Mode.ALWAYS_PLAIN) { ExpressionsOfTypeProcessor.testLog = logList diff --git a/idea/tests/org/jetbrains/kotlin/findUsages/FindUsagesTestGenerated.java b/idea/tests/org/jetbrains/kotlin/findUsages/FindUsagesTestGenerated.java index c376ac8f4ce..a265b4125eb 100644 --- a/idea/tests/org/jetbrains/kotlin/findUsages/FindUsagesTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/findUsages/FindUsagesTestGenerated.java @@ -724,6 +724,11 @@ public class FindUsagesTestGenerated extends AbstractFindUsagesTest { runTest("idea/testData/findUsages/kotlin/findFunctionUsages/localClassMember.0.kt"); } + @TestMetadata("nonBaseDeclarationFunctionAsPropName.0.kt") + public void testNonBaseDeclarationFunctionAsPropName() throws Exception { + runTest("idea/testData/findUsages/kotlin/findFunctionUsages/nonBaseDeclarationFunctionAsPropName.0.kt"); + } + @TestMetadata("objectExpressionDeepMember.0.kt") public void testObjectExpressionDeepMember() throws Exception { runTest("idea/testData/findUsages/kotlin/findFunctionUsages/objectExpressionDeepMember.0.kt");