Search code examples
kotlinkdoc

How to link to a static member of a Java class in KDoc?


In KDoc, you can do this:

/**
 * [Integer.equals] is an instance method.
 */

But you can't do this:

/**
 * [Integer.signum] is a static method.
 */

By "you can't" I mean that IntelliJ IDEA won't lead you to the declaration of a static member if you use Navigate → Declaration action on it. Navigating to static fields doesn't work as well.

Is there a way to link to static members of Java classes in KDoc? Is this probably just a bug in IDEA?


Solution

  • This is a bug. It has been fixed in more recent versions of the Kotlin IntelliJ plugin: https://youtrack.jetbrains.com/issue/KT-9946