-
Notifications
You must be signed in to change notification settings - Fork 9
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
Comments
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. |
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 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. |
Wanted to double-check here, did you mean WidgetInheritingImported for one of above two? |
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. |
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. |
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?). |
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. |
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). |
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. |
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. |
See #7 |
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:
=> 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)
The text was updated successfully, but these errors were encountered: