-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Suggestion: Return type in function declaration & possible option to view types by clicking in doc #14624
Comments
Most functions (not |
Yeah I'm not really for putting it in the heading either |
@Fishrock123 A reasoning would be nice |
Easiest argument against it is that that would break links to the docs. Fixing that would probably be non-trivial in the build tooling. Another is that the return type is already listed. That being said, while we do have some function with different "argument signatures", it just doesn't operate int he same was a typed language does and as such I'm not certain the same notation is desirable. Finally, this gets really messy when dealing with async functions that call callbacks with data. (Which most of the significant API is.) |
@gibfahn That sounds amazing! |
Closing this, discussion can continue on the closed thread if needed. |
The |
While working with Node.js, I found having the return types of a function (If given) in the function declaration instead of somewhere in the paragraph below it (As seen in the example following) might improve the documentation.
Further on, it would most likely be useful to be able to click on the types. Both suggestions are popular documentation features, example is the Rust Documentation
Here a screenshot of what I mean
The text was updated successfully, but these errors were encountered: