Find Usages: Support primary constructors

#KT-7881 Fixed
This commit is contained in:
Alexey Sedunov
2015-06-08 18:42:13 +03:00
parent 1ea2c24562
commit e2d758463f
18 changed files with 188 additions and 9 deletions
@@ -0,0 +1,14 @@
// PSI_ELEMENT: com.intellij.psi.PsiMethod
// OPTIONS: usages
// FIND_BY_REF
// WITH_FILE_NAME
class J extends A {
constructor(n: Int) {
super(n);
}
static void test() {
new A();
new <caret>A(1);
}
}
@@ -0,0 +1,14 @@
open class A (n: Int) {
constructor(): this(1)
}
class B: A {
constructor(n: Int): super(n)
}
class C(): A(1)
fun test() {
A()
A(1)
}
@@ -0,0 +1,6 @@
[primaryConstructorByJavaRef.0.java] New instance creation (12: 13) new A(1);
[primaryConstructorByJavaRef.0.java] Unclassified usage (7: 9) super(n);
[primaryConstructorByJavaRef.1.kt] New instance creation (13: 5) A(1)
[primaryConstructorByJavaRef.1.kt] Supertype (9: 12) class C(): A(1)
[primaryConstructorByJavaRef.1.kt] Unclassified usage (2: 20) constructor(): this(1)
[primaryConstructorByJavaRef.1.kt] Unclassified usage (6: 26) constructor(n: Int): super(n)
@@ -0,0 +1,14 @@
// PSI_ELEMENT: com.intellij.psi.PsiMethod
// OPTIONS: usages
// FIND_BY_REF
// WITH_FILE_NAME
class J extends A {
constructor(n: Int) {
<caret>super(n);
}
static void test() {
new A();
new A(1);
}
}
@@ -0,0 +1,14 @@
open class A (n: Int) {
constructor(): this(1)
}
class B: A {
constructor(n: Int): super(n)
}
class C(): A(1)
fun test() {
A()
A(1)
}
@@ -0,0 +1,6 @@
[primaryConstructorByJavaSuperRef.0.java] New instance creation (12: 13) new A(1);
[primaryConstructorByJavaSuperRef.0.java] Unclassified usage (7: 9) super(n);
[primaryConstructorByJavaSuperRef.1.kt] New instance creation (13: 5) A(1)
[primaryConstructorByJavaSuperRef.1.kt] Supertype (9: 12) class C(): A(1)
[primaryConstructorByJavaSuperRef.1.kt] Unclassified usage (2: 20) constructor(): this(1)
[primaryConstructorByJavaSuperRef.1.kt] Unclassified usage (6: 26) constructor(n: Int): super(n)
@@ -0,0 +1,17 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetPrimaryConstructor
// OPTIONS: usages
// FIND_BY_REF
open class A (n: Int) {
constructor(): this(1)
}
class B: A {
constructor(n: Int): super(n)
}
class C(): A(1)
fun test() {
A()
<caret>A(1)
}
@@ -0,0 +1,4 @@
New instance creation (16: 5) A(1)
Supertype (12: 12) class C(): A(1)
Unclassified usage (5: 20) constructor(): this(1)
Unclassified usage (9: 26) constructor(n: Int): super(n)
@@ -0,0 +1,16 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetPrimaryConstructor
// OPTIONS: usages
open class A <caret>(n: Int) {
constructor(): this(1)
}
class B: A {
constructor(n: Int): super(n)
}
class C(): A(1)
fun test() {
A()
A(1)
}
@@ -0,0 +1,4 @@
New instance creation (15: 5) A(1)
Supertype (11: 12) class C(): A(1)
Unclassified usage (4: 20) constructor(): this(1)
Unclassified usage (8: 26) constructor(n: Int): super(n)
@@ -0,0 +1,16 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetPrimaryConstructor
// OPTIONS: usages
open class A <caret>constructor(n: Int) {
constructor(): this(1)
}
class B: A {
constructor(n: Int): super(n)
}
class C(): A(1)
fun test() {
A()
A(1)
}
@@ -0,0 +1,4 @@
New instance creation (15: 5) A(1)
Supertype (11: 12) class C(): A(1)
Unclassified usage (4: 20) constructor(): this(1)
Unclassified usage (8: 26) constructor(n: Int): super(n)