Skip to content

Emit jsdoc consistent with ts users expectations #106

@niloc132

Description

@niloc132

There are a few mismatches between how Javadoc and Java annotations work vs how typescript and typedoc behave around inheritance:

  • Inherited members in TS must be re-declared in subtypes
  • In Java, @Deprecated is inherited (though confusingly, it isn't itself marked as @Inherited, and I can't find specific docs that suggest it should be treated that way). The Typedoc tool treats @deprecated like it is inherited, and displays overrides as being deprecated, but typescript in VSCode does not show the overridden member to be deprecated.
  • The ts annotation @deprecated is a typedoc tag, so to explicitly mark downstream members as deprecated (as Java treats them), the downstream member needs jsdoc.
  • Like javadoc, if an overriding member has its own jsdoc, the overridden element's docs are ignored. One way to deal with that is @inheritDoc.

My conclusion is that a Java type/method with a) no javadoc that b) extends from or overrides something deprecated should always have a short typedoc string attached to it:

/**
 * @inheritDoc
 * @deprecated
 */

This will correctly show that the type/member is deprecated, and will still show the expected documentation.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions