You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using @inheritDoc then only the method documentation is copied. Parameter documentation is not copied.
Versions:
TypeDoc v0.11.1
Node v10.4.0
Reproduction code:
// test.tsinterfaceBase{/** * Base doc. * * @param p Param doc. * @return Return value doc. */method(p: number): string;}classTestimplementsBase{/** @inheritDoc */method(p: number): string{return"";}}
$ typedoc --out doc test.ts
Expected behavior:
The parameter p of the Test class must be documented with the text Param doc.
Actual behavior:
Parameter p is not documented at all. Only the name and type is printed to the HTML output.
The reason for this can be found in ImplementsPlugin.copyComment. This method only copies the parameter documentation when the parameter is already documented on the target method. This isn't the case when the method is simply annotated with @inheritDoc. There must be at least a @param p comment so the parameter documentation gets copied from the interface.
This can easily be fixed by reversing the logic. When target parameter is not already documented then copy documentation from the interface. This fixes the issue and also allows to write a more specific documentation for the parameter in the class.
This can be fixed with a few lines of code. Maybe I'll come up with a PR soon.
The text was updated successfully, but these errors were encountered:
When using
@inheritDoc
then only the method documentation is copied. Parameter documentation is not copied.Versions:
Reproduction code:
Expected behavior:
The parameter
p
of theTest
class must be documented with the textParam doc
.Actual behavior:
Parameter
p
is not documented at all. Only the name and type is printed to the HTML output.The reason for this can be found in
ImplementsPlugin.copyComment
. This method only copies the parameter documentation when the parameter is already documented on the target method. This isn't the case when the method is simply annotated with@inheritDoc
. There must be at least a@param p
comment so the parameter documentation gets copied from the interface.This can easily be fixed by reversing the logic. When target parameter is not already documented then copy documentation from the interface. This fixes the issue and also allows to write a more specific documentation for the parameter in the class.
This can be fixed with a few lines of code. Maybe I'll come up with a PR soon.
The text was updated successfully, but these errors were encountered: