Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit jsdoc consistent with ts users expectations #106

Open
niloc132 opened this issue Apr 23, 2024 · 0 comments · May be fixed by #107
Open

Emit jsdoc consistent with ts users expectations #106

niloc132 opened this issue Apr 23, 2024 · 0 comments · May be fixed by #107
Assignees

Comments

@niloc132
Copy link
Member

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.

vegegoku added a commit to vegegoku/jsinterop-ts-defs that referenced this issue Apr 24, 2024
Mark method as deprecated if recursively it overrides a deprecated method, and adds inheritDoc tag if the overriding method does not provide its own documentation.

fix Vertispan#106
@vegegoku vegegoku linked a pull request Apr 24, 2024 that will close this issue
vegegoku added a commit to vegegoku/jsinterop-ts-defs that referenced this issue Apr 25, 2024
Mark method as deprecated if recursively it overrides a deprecated method, and adds inheritDoc tag if the overriding method does not provide its own documentation.

fix Vertispan#106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants