Animesh Sahu
10/31/2020, 2:55 PM@inheritDoc
. Something even more extensible and familiar, more like:
/**
* @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
:
@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.Zach Klippenstein (he/him) [MOD]
11/02/2020, 5:08 PMAnimesh Sahu
11/03/2020, 3:10 AM