9

For the two given methods:

/**
* Adds a [DataItem] to the Android Wear network. The updated item is synchronized across all devices.
*/
fun putItem(){ .... }

/**
* "same KDOC here with above"
*/
fun putItem(putRequest: PutDataRequest){ .... }

Is there any possibility to copy/link the docs of the second method to be the same with the first one?

Manually copy pasting the KDOC is not so great because if you update one of them there is high chance the second to accidentally be outdated.

Elias Mårtenson
  • 3,820
  • 23
  • 32
Diolor
  • 13,181
  • 30
  • 111
  • 179
  • 1
    Probably no. If there was a way, it would be usable for inheriting KDoc, but my similar question got negative answer: http://stackoverflow.com/questions/35776564/how-do-i-inherit-kdoc-documentation – hotkey Mar 12 '16 at 10:58
  • This might make a good feature request in https://youtrack.jetbrains.com ... although you do have a different parameter so not sure how you will say "same as above, plus this little bit extra" – Jayson Minard Mar 12 '16 at 23:41
  • 1
    It may be a better design to change `putRequest` to an optional parameter. Then you won't have any overloads and won't need to copy the documentation. – yole Mar 14 '16 at 18:43
  • @yole In my example fits great, thank you. But there are cases with same method name and result but different param types. – Diolor Mar 14 '16 at 19:24

1 Answers1

5

There is no such feature currently available in KDOC.

Please submit a feature request to YouTrack.

The reference guide for KDOC shows the feature set available.

Jayson Minard
  • 84,842
  • 38
  • 184
  • 227