-->

Reference value of constant with KDoc

2020-03-26 08:37发布

问题:

I have a object like the following in my project

object UrlUtils {

    private const val PARAM = "whatever"

    /**
     * Method that appends the [PARAM] parameter to the url
     */
    fun appendParameter(url: String) {
        // ...
    }

}

As you can see a I wanna reference the value of the PARAM field in the KDoc comment of the appendParameter method however when looking at the comment I don't see the actual value but only the name of the field.

Method that appends the PARAM parameter to the url

What I want:

Method that appends the whatever parameter to the url

In Javadoc this works by using {@value PARAM} but there seems to be nothing similar in KDoc. Even the automatic code-converter keeps the old Javadoc.

So my question: Am I missing something or is KDoc/Dokka missing this feature?

回答1:

Currently, {@value} tags are not supported by KDoc.

The closest issue requesting this is #488, so you can up-vote and/or comment on it.