I wish if there could be a substitute for `@inheri...
# language-proposals
a
I wish if there could be a substitute for
@inheritDoc
. Something even more extensible and familiar, more like:
Copy code
/**
 * @copyFrom SuperClassOrInterfaceManualSelection.someFunctionName
 * // extended docs with other info
 */
• It could be used by IDE to jump into correct definition. • It could be beneficial to follow strict code styles where a KDoc is required on public/internal/protected functions. • It can and also give the user a clue from where the doc is being inherited from, such as if a class has multiple Interface inheritence (and no superclass) with same function defined with different KDoc one can assure the overridden KDoc follows the particular interface. • Same goes (on rare cases) if one wants to inherit KDoc from the interface instead of super class (if class both extend a class and implement interface(s)). Edit: Another idea came in my mind extending the above feature-request/proposal, if there can be pythonic style line selector in
@copyFrom
:
Copy code
@copyFrom Interface.method[1:5]  // copy/inherit line 1 to 5 (exclusive or maybe inclusive)
@copyFrom Interface.method[2:]   // copy/inherit line 2 to the last line
@copyFrom Interface.method[:6]   // copy/inherit from first line to line 6

// Below are not important part of this proposal, but maybe easier to select from bottom if the KDoc of Interface.method was long enough
@copyFrom Interface.method[:-2]   // copy/inherit from first line to second last line
Apologies for any grammatical errors and/or improper formatting.
💜 4
z
Agree, would love this! But this isn't a kotlin language feature request, it's a #dokka feature request. Might want to post there.
a
@Zach Klippenstein (he/him) [MOD] I thought dokka is more like html documentation generator, while KDoc is language feature itself 😅😅, Will do!