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

Implement a way to hide methods inherited from superclass #5

Open
AdrianVasiliu opened this issue Mar 31, 2014 · 11 comments
Open

Implement a way to hide methods inherited from superclass #5

AdrianVasiliu opened this issue Mar 31, 2014 · 11 comments

Comments

@AdrianVasiliu
Copy link

When generating the standalone doc of a project, methods inherited from superclasses but not overridden (or without a JSDoc comment) are not shown. So far so good. However, if the project depends on another project and the doclet of this other project is imported, all inherited methods show up.

Can be reproduced using the sample projects included in this repository:

  1. Export the doclet of sampleframework (on which sampleproject depends)
  2. Create the doc for sampleprojects/sampleproject
    => the doc of sampleproject/Widget shows all methods inherited from Base0 and Base1.
    (all steps done using the commands documented in the project's README.md)
@asudoh
Copy link
Contributor

asudoh commented Apr 1, 2014

Created a test case for this, but it appears that JSDoc emits all properties/methods of parent classes, no matter the parent class is an imported one or not. Tested without our custom templates or plugins. Wanted to understand your test case to see if this is an issue in JSDoc or not.

@AdrianVasiliu
Copy link
Author

With jsdoc-amddcl as of yesterday evening (before your commit which splits sampleproject/Widget into WidgetInheritedImported and WidgetInheritedInHouse), it went for me as folows:

Creating the doc of sampleprojects/sampleproject without importing the doclet of sampleframework, I get the doc of sampleproject/Widget showing one only one method (createdCallback()). So far so good.
After generating the doclet of sampleprojects/sampleframework, regenerating the doc of sampleprojects/sampleproject (thus, importing the doclet of sampleframework) leads to the doc of Widget showing 4 methods (including the 3 methods inherited from the parent classes).

After updating to the current code in jsdoc-amddcl, I get as expected only one method in the doc of WidgetInheritedInHouse and 4 methods in the doc of WidgetInheritedInHouse, if I generate the doc of sampleproject WITHOUT importing the doclet of sampleframework. But when importing it, the doc of both classes shows 4 methods.

@asudoh
Copy link
Contributor

asudoh commented Apr 1, 2014

I get as expected only one method in the doc of WidgetInheritedInHouse and 4 methods in the doc of WidgetInheritedInHouse

Wanted to double-check here, did you mean WidgetInheritingImported for one of above two?

@AdrianVasiliu
Copy link
Author

Argh, yes, here's a corrected version:

Without importing the doclet of sampleframework, I get only 1 method (createdCallback()) shown for WidgetInheritingImported, and 4 methods shown for WidgetInheritingInHouse.

And I get 4 methods shown for both if importing the doclet of sampleframework.

In my eyes, we shouldn't show the inherited methods in any case. Having a checkbox to allow the user to turn them visible would be a plus, but I think they shouldn't be shown by default because we'd quickly get a huge doc page for deep hierarchies of classes with a rich API.

@asudoh
Copy link
Contributor

asudoh commented Apr 1, 2014

Thanks @AdrianVasiliu for clarification. Given WidgetInheritingInHouse showed 4 methods, it's an issue with JSDoc. Edited the subject as such. Let's see we can get it around with a plugin or a change to our template.

@asudoh asudoh changed the title Methods inherited from superclass are shown when importing doclets of dependent projects Implement a way to hide methods inherited from superclass Apr 1, 2014
@AdrianVasiliu
Copy link
Author

Well, when I used the default jsdoc template, I did not get the same behavior, that is a class (actually, a mixin tagged with @mixin) did not show in its doc the APIs from its parent classes located in the same project ("in house", in your terms). See for instance http://adrianvasiliu.github.io/deliteful/delite-and-deliteful-jsdoc-out/Scrollable.html where no inherited APi shows up.

On the other side, http://adrianvasiliu.github.io/deliteful/delite-and-deliteful-jsdoc-out/Widget.html does show up the defer() method which is inherited from delite/CustomElement. I'm not sure what makes the difference (is it the @mixin tag?).

@asudoh
Copy link
Contributor

asudoh commented Apr 1, 2014

This is the information I was looking for, thanks. It will be great if you have some time to create a reduced test case and push it to this repo.

@AdrianVasiliu
Copy link
Author

Okay, will do it - just to be sure, you mean a test case showing the difference when @mixin is used, right? (the initial issue is already shown by the existing test case).

@asudoh
Copy link
Contributor

asudoh commented Apr 1, 2014

Thanks @AdrianVasiliu. Given I see methods of parent class (without override) is all shown for my test case with pure JSDoc, I'm looking for a test case where methods of parent class is not shown.

@AdrianVasiliu
Copy link
Author

I have tested with jsdoc-amddcl/sampleprojects by adding @mixin to sampleproject/WidgetInheritingImported.js and WidgetInheritingInHouse.js. This has the effect that the inherited APIs are NOT shown for both. So at least with this tag the inherited APIs are hidden even with the admdcl template.

So this confirms that it's indeed the effect of @mixin that we see with the default template in http://adrianvasiliu.github.io/deliteful/delite-and-deliteful-jsdoc-out/Scrollable.html (which doesn't show the inherited APIs).

Hence, I make a PR for adding test cases with @mixin.

@AdrianVasiliu
Copy link
Author

See #7

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