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
@inheritDoc and @override tags support. #53
Comments
Yes. |
I have a plugin that sort of does this (well it has an I can share if you interested (it works for my code but is not widely tested)? |
I am interested @mathematicalcoffee . |
Having this fixed would be a great for http://github.com/openlayers/ol3 as well. For now I have created a custom plugin that replaces
The strange but useful side effect of this is that the inherited docs get applied then. This is the plugin code:
|
As noted on the mailing list, I'm currently planning to implement this for JSDoc 3.3. It would also be useful to support something like the JSDuck flavor of this tag (à la @mathematicalcoffee's plugin), which allows you to specify where to inherit from: /** @class */
function MyClass() {}
/**
* A great method with a very wordy description that I want to reuse
* somewhere else because I don't like typing and I try to keep things DRY
* and I don't feel like writing more docs and it's late and I'm tired.
*/
MyClass.prototype.foo = function() {};
/**
* @inheritdoc MyClass#foo
*/
MyClass.prototype.bar = function() {}; I also think that any tags in |
Also, if a subclass overrides a superclass' method, and the subclass' method doesn't have any docs, let's assume the user meant to put an (Updated 2013-06-11 to address abstract methods.) |
The plugin I wrote (out of date, written 5 months ago and not updated to new |
Any updates on this? ahocevar's hack seems to do ok as a workaround, but i'm curious where things are with 3.3 |
A workaround could be omitting docblock on the super method; And it feels strange in code. |
The If a symbol has the You can use We don't currently support explicit inheritance from a specific symbol (for example, |
The changes for this issue caused a weird crash to occur when generating docs for JSDoc itself. The fix is in 2b6d2de. The logic was clearly wrong, but it's not clear exactly what triggers the crash. JSDoc 3.3.0-alpha12 includes support for the new tags. If others run into the same crash, I'll release a new alpha with the fix. |
For posterity: JSDoc 3.3.0-alpha13 fixes the crash. |
What is the difference between In both cases, it simply repeats the documentation of the inherited member. (I cannot modify, say, a |
Anyone knows how to make this work in VSCode? I suppose they need to implement support for this tag themselves to display it in the IDE, right? |
Currently JSDoc ignores
@inheritDoc
and@override
tags, however it would be nice to replace them with superclass's (modified in case of@overrride
tag) docstrings in HTML documentation.The text was updated successfully, but these errors were encountered: