Skip to content

Display inherited methods from extended class #624

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

Closed
jmakeig opened this issue Dec 4, 2016 · 2 comments
Closed

Display inherited methods from extended class #624

jmakeig opened this issue Dec 4, 2016 · 2 comments

Comments

@jmakeig
Copy link

jmakeig commented Dec 4, 2016

I’d like to implement printing inherited methods and properties in the context of an extended class’s documentation. For example, if Bar extends Foo, Bar’s listing should include all of the methods and properties on Foo.prototype in addition to those defined explicitly on Bar.prototype. Additionally, zero or more methods on Bar.prototype may override methods defined on Foo.prototype.

  1. Is this useful functionality that meets others’ needs?
  2. Has anyone implemented (or contemplated) this already?

I’m relatively new to this project, so pointers on how to proceed would be appreciated. Is there another tag that I can use for implementation guidance? I think most of the work will actually be in the HTML renderer. @augements and @override look to be implemented in the core already (#9).

@jmakeig jmakeig changed the title Print inherited methods from extended class Display inherited methods from extended class Dec 5, 2016
@tmcw
Copy link
Member

tmcw commented Dec 11, 2016

Hey Justin,

Yep, we're tracking this feature request in #390.

Right now instead of showing inherited methods inline as instance methods, we simply show an 'Extends Foo' annotation in the documentation.

I'm open to the idea - I expect a few things to come up, though:

If you go all the way down the line - showing instance methods like toStrings that are inherited by Foo and then Bar - then you might end up with lots of inherited methods that aren't really relevant to your source code. This would require either a much different documentation style, like a toggle or de-emphasized inheritance, or for the option to be controllable, and there I'm not sure if it would be controllable globally or locally through documentation tags - both have pros and cons.

I'm going to close this to keep tracking this request at #390, and I 👍'ed that issue to register that it has been requested more than once!

  • Tom

@tmcw tmcw closed this as completed Dec 11, 2016
@jmakeig
Copy link
Author

jmakeig commented Dec 11, 2016

If you go all the way down the line - showing instance methods, like toString, that are inherited

Yes, I hadn’t considered that. Default JavaDoc, for example, lists the inherited methods/properties in a separate section for each ancestor. I guess I want to be able to see all of the available methods for a given instance, including Object.prototype. I’ll add to #390. Thanks for your responsiveness.

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

No branches or pull requests

2 participants