Find usages and reference to delegation origin

This commit is contained in:
Nikolay Krasko
2015-02-24 21:52:52 +03:00
parent 377209f0c3
commit f3919db592
12 changed files with 100 additions and 3 deletions
@@ -0,0 +1,11 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetNamedFunction
// OPTIONS: usages, skipImports
package server
trait TraitWithImpl {
fun <caret>foo() = 1
}
public class TraitWithDelegatedWithImpl(f: TraitWithImpl): TraitWithImpl by f
fun test(twdwi: TraitWithDelegatedWithImpl) = twdwi.foo()
@@ -0,0 +1,9 @@
package client;
import server.TraitWithDelegatedWithImpl;
public class Test {
public static void bar(TraitWithDelegatedWithImpl some) {
some.foo();
}
}
@@ -0,0 +1,2 @@
Function call (11: 53) fun test(twdwi: TraitWithDelegatedWithImpl) = twdwi.foo()
Unclassified usage (7: 14) some.foo();
@@ -0,0 +1,11 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.JetNamedFunction
// OPTIONS: usages, skipImports
package server
trait TraitNoImpl {
fun <caret>foo()
}
public class TraitWithDelegatedNoImpl(f: TraitNoImpl): TraitNoImpl by f
fun test(twdni: TraitWithDelegatedNoImpl) = twdni.foo()
@@ -0,0 +1,9 @@
package client;
import server.TraitWithDelegatedNoImpl;
public class JClient {
public static void bar(TraitWithDelegatedNoImpl some) {
some.foo();
}
}
@@ -0,0 +1,2 @@
Function call (11: 51) fun test(twdni: TraitWithDelegatedNoImpl) = twdni.foo()
Unclassified usage (7: 14) some.foo();
@@ -0,0 +1,9 @@
import k.*;
public class Test {
public static void bar(TraitWithDelegatedNoImpl some) {
some.<caret>foo();
}
}
// REF: (in k.TraitNoImpl).foo()
@@ -0,0 +1,9 @@
import k.*;
public class Test {
public static void bar(TraitWithDelegatedWithImpl some) {
some.<caret>foo();
}
}
// REF: (in k.TraitWithImpl).foo()
@@ -39,4 +39,12 @@ object PlatformStaticFun {
trait TraitNoImpl {
fun foo()
}
}
public class TraitWithDelegatedNoImpl(f: TraitNoImpl): TraitNoImpl by f
trait TraitWithImpl {
fun foo() = 1
}
public class TraitWithDelegatedWithImpl(f: TraitWithImpl): TraitWithImpl by f