Find Usages: Fixed searching of Java usages for @JvmStatic properties and @JvmStatic @JvmOverloads functions

#KT-11736 Fixed
This commit is contained in:
Alexey Sedunov
2016-04-19 15:13:31 +03:00
parent 1635018fe7
commit 021c88e5ff
23 changed files with 182 additions and 15 deletions
@@ -0,0 +1,9 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtNamedFunction
// OPTIONS: usages
class Foo {
companion object {
@JvmStatic fun <caret>foo() {
}
}
}
@@ -0,0 +1,5 @@
class Bar {
{
Foo.foo();
}
}
@@ -0,0 +1 @@
Unclassified usage 3 Foo.foo();
@@ -0,0 +1,11 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtNamedFunction
// OPTIONS: usages
class Foo {
companion object {
@JvmStatic
@JvmOverloads
fun <caret>foo(n: Int = 1) {
}
}
}
@@ -0,0 +1,6 @@
class Bar {
{
Foo.foo(2);
Foo.foo();
}
}
@@ -0,0 +1,2 @@
Unclassified usage 3 Foo.foo(2);
Unclassified usage 4 Foo.foo();
@@ -0,0 +1,7 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtProperty
// OPTIONS: usages
class Foo {
companion object {
@JvmStatic var <caret>foo = 1
}
}
@@ -0,0 +1,6 @@
class Bar {
{
Foo.getFoo();
Foo.setFoo(2);
}
}
@@ -0,0 +1,2 @@
Unclassified usage 3 Foo.getFoo();
Unclassified usage 4 Foo.setFoo(2);
@@ -0,0 +1,9 @@
package testing.rename
public open class C {
companion object {
@JvmStatic
@JvmOverloads
fun second(n: Int = 1) {}
}
}
@@ -0,0 +1,10 @@
package testing;
import testing.rename.C;
class JavaClient {
public void foo() {
C.second(2);
C.second();
}
}
@@ -0,0 +1,9 @@
package testing.rename
public open class C {
companion object {
@JvmStatic
@JvmOverloads
fun first(n: Int = 1) {}
}
}
@@ -0,0 +1,10 @@
package testing;
import testing.rename.C;
class JavaClient {
public void foo() {
C.first(2);
C.first();
}
}
@@ -0,0 +1,7 @@
{
"type": "KOTLIN_FUNCTION",
"classId": "testing/rename/C.Companion",
"oldName": "first",
"newName": "second",
"withRuntime": "true"
}
@@ -0,0 +1,7 @@
package testing.rename
public open class C {
companion object {
@JvmStatic var second = 1
}
}
@@ -0,0 +1,10 @@
package testing;
import testing.rename.C;
class JavaClient {
public void foo() {
C.getSecond();
C.setSecond(2);
}
}
@@ -0,0 +1,7 @@
package testing.rename
public open class C {
companion object {
@JvmStatic var first = 1
}
}
@@ -0,0 +1,10 @@
package testing;
import testing.rename.C;
class JavaClient {
public void foo() {
C.getFirst();
C.setFirst(2);
}
}
@@ -0,0 +1,7 @@
{
"type": "KOTLIN_PROPERTY",
"classId": "testing/rename/C.Companion",
"oldName": "first",
"newName": "second",
"withRuntime": "true"
}