I like how I am able to jump to a method when usin...
# intellij
r
I like how I am able to jump to a method when using JUnit's MethodSource, is there a way to define the same behaviour for a custom annotation, also requiring a method name?
not kotlin but kotlin colored 1
r
thanks for the pointer
e
Dont think the issue is necessary, this is built into IDE as language injection. Inject language on your annotation string parameter and use method reference
r
can you point me to something how
Inject language on your annotation string parameter and use method reference
can be done?
e
I assume they mean something like
Copy code
annotation class MySource(
    @Language("java")
    val method: String,
)

@MySource("com.example.Something::somehow")
but in any case, the IDE integration isn't a JUnit issue
e
Copy code
internal annotation class InternalMediaApi(
  @Language("jvm-method-name") val string: String = ""
)
👍 1
e
if you want it to work a specific different way, you can write your own intellij plugin
r
nice, glad I asked, the @Language annotation solved my issue nicely 🙂