Kotlin / dokka

API documentation engine for Kotlin

Home Page:https://kotl.in/dokka

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The location of KDoc in the code is not specified well

vmishenev opened this issue · comments

class Foo(
  /**
   * This is a bar property
   */
  val bar: String
)

or the example from Dokka's codebase


This case works for the Dokka and IDE.

Also, it works for a value parameter in a primary constructor.
image

There is the more weird case (working in the Dokka and IDE):

class /**This is a class*/ Foo (
     p: /**This is a param*/ Int
)

From the current KDoc documentation for @property

This tag can be used for documenting properties declared in the primary constructor, where putting a doc comment directly before the property definition would be awkward.

Maybe, to resolve this issue, we need to have a style guide like Javadoc's one.