Is it possible to link Java method from Kotlin comment?

TGar :

I have an Android project where Java and Kotlin files are mixed. I am writing a comment in one of the Kotlin files and I want to link some method in Java file.

Is this possible? How?

For Kotlin I do:

/**
*    [ResultMatcher.getCount]
*/

But when ResultMatcher is java class it doesn't work. I tried adding different symbols (_,#) and .java or ::class but it didn't help.

Karol Dowbecki :

Most likely ResultMatcher is not the full qualified name and you don't have an import.

Below works in IntelliJ, you can click on size and it will navigate to the method body:

import java.util.ArrayList

/**
 * [ArrayList.size]
 */
fun main() { }

and this also works:

/**
 * [java.util.ArrayList.size]
 */
fun main() { }

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=6107&siteId=1