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

Generate JSDoc comments for generated code #521

Closed
DanielMSchmidt opened this issue Jan 16, 2018 · 7 comments
Closed

Generate JSDoc comments for generated code #521

DanielMSchmidt opened this issue Jan 16, 2018 · 7 comments

Comments

@DanielMSchmidt
Copy link
Contributor

It might be useful (especially for new contributors) to have jsdoc comments on the generated classes that indicate how to use it. These would also show up per autosuggest in some editors, which would be a nice benefit on top.

The reason why I want to add this is

a) It's fairly easy to accomplish, we have all the information needed and only 2-5 special cases (Matcher<View>, id<GREYMatcher>, ...) to take care of
b) A bit of documentation could make the code a bit more understandable

My approach would be to have a JSDoc comment like this generated:

/**
* Invokes scrollToEdge on com.wix.detox.espresso.Detoxaction
* @param {String} edge One of "top", "bottom", "left, and "right"
* @example 
*   this._call = invoke.callDirectly(DetoxAction.scrollToEdge("top"));
**/
scrollToEdge(edge) {
@DanielMSchmidt
Copy link
Contributor Author

What do you think, is this something worth to spend time on or is it just me seeing a point here? Please be honest ;)

@LeoNatan
Copy link
Contributor

Yes, very important!
I think we should most of our documentation to this type of code documentation and generate the .md files out of those. That's much easier for developers to follow.

@DanielMSchmidt
Copy link
Contributor Author

Generating stuff from these comments is super hard :(

@LeoNatan
Copy link
Contributor

Could you please elaborate?

@rotemmiz
Copy link
Contributor

In @DanielMSchmidt we trust !
but yes, please elaborate :)

@DanielMSchmidt
Copy link
Contributor Author

Will try my best 🙈

@LeoNatan See the conversation in #491 (comment) I tried to communicate it as good as I can :)

@DanielMSchmidt
Copy link
Contributor Author

I would see #563 as follow up on this, so I close this issue now. If you disagree feel free to tell me, I will reopen this 👍

@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants