Java Resolver: Substitute original element when resolving PsiMethod to FunctionDescriptor

#KT-7353 Fixed
This commit is contained in:
Alexey Sedunov
2015-05-22 15:08:52 +03:00
parent babb7e58bc
commit b2201026d1
18 changed files with 214 additions and 5 deletions
@@ -0,0 +1,18 @@
package library;
public class Foo {
public int x;
public static int X;
public Foo(int n) {
}
public void bar(int n) {
}
public static void baz(int n) {
}
}
@@ -0,0 +1,11 @@
// PSI_ELEMENT: com.intellij.psi.PsiClass
// OPTIONS: usages
// FIND_BY_REF
// FIND_BY_NAVIGATION_ELEMENT
package usages
import library.Foo
fun test() {
val foo: <caret>Foo
}
@@ -0,0 +1,2 @@
Local variable declaration (10: 14) val foo: Foo
Usage in import (7: 16) import library.Foo
@@ -0,0 +1,11 @@
// PSI_ELEMENT: com.intellij.psi.PsiMethod
// OPTIONS: usages
// FIND_BY_REF
// FIND_BY_NAVIGATION_ELEMENT
package usages
import library.Foo
fun test() {
<caret>Foo(1)
}
@@ -0,0 +1 @@
New instance creation (10: 5) Foo(1)
@@ -0,0 +1,11 @@
// PSI_ELEMENT: com.intellij.psi.PsiField
// OPTIONS: usages
// FIND_BY_REF
// FIND_BY_NAVIGATION_ELEMENT
package usages
import library.Foo
fun test() {
Foo().<caret>x = 1
}
@@ -0,0 +1 @@
Value write (10: 11) Foo().x = 1
@@ -0,0 +1,11 @@
// PSI_ELEMENT: com.intellij.psi.PsiMethod
// OPTIONS: usages
// FIND_BY_REF
// FIND_BY_NAVIGATION_ELEMENT
package usages
import library.Foo
fun test() {
Foo().<caret>bar(1)
}
@@ -0,0 +1 @@
Function call (10: 11) Foo().bar(1)
@@ -0,0 +1,11 @@
// PSI_ELEMENT: com.intellij.psi.PsiField
// OPTIONS: usages
// FIND_BY_REF
// FIND_BY_NAVIGATION_ELEMENT
package usages
import library.Foo
fun test() {
Foo.<caret>X = 1
}
@@ -0,0 +1 @@
Value write (10: 9) Foo.X = 1
@@ -0,0 +1,11 @@
// PSI_ELEMENT: com.intellij.psi.PsiMethod
// OPTIONS: usages
// FIND_BY_REF
// FIND_BY_NAVIGATION_ELEMENT
package usages
import library.Foo
fun test() {
Foo.<caret>baz(1)
}
@@ -0,0 +1 @@
Function call (10: 9) Foo.baz(1)