Find Usages: Fix reference check for the case of multiple resolve results

This commit is contained in:
Alexey Sedunov
2014-10-09 16:14:31 +04:00
parent f0a0df94b5
commit 0d220c68ea
9 changed files with 69 additions and 2 deletions
@@ -1,5 +1,6 @@
Function call (12: 20) A(0).plus(A(1).plus(2))
Function call (10: 17) A(0) + A(1) + 2
Function call (11: 20) A(0) plus A(1) plus 2
Function call (12: 20) A(0).plus(A(1).plus(2))
Function call (15: 7) a += 1
Function call (6: 30) fun plus(a: A): A = this + a.n
Unclassified usage (18: 5) +A(0)
@@ -0,0 +1,17 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: usages
package server
fun <caret>foo() {
}
fun Int.foo() {
}
fun foo(n: Int) {
}
val foo: Int
@@ -0,0 +1,11 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetNamedFunction
// OPTIONS: usages
package client
import server.foo
fun test() {
foo()
foo(1)
val t = foo
}
@@ -0,0 +1,2 @@
Function call (8: 5) foo()
Usage in import (5: 15) import server.foo
@@ -0,0 +1,11 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetProperty
// OPTIONS: usages
package server
fun foo() {
}
val <caret>foo: Int = 1
val Int.foo: Int = 2
@@ -0,0 +1,10 @@
// PSI_ELEMENT: org.jetbrains.jet.lang.psi.JetProperty
// OPTIONS: usages
package client
import server.foo
fun test() {
foo()
val t = 1.foo + foo
}
@@ -0,0 +1,2 @@
Usage in import (5: 15) import server.foo
Value read (9: 21) val t = 1.foo + foo