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

Coalesce function **Returns** sections #2180

Closed
ilg-ul opened this issue Feb 22, 2023 · 8 comments
Closed

Coalesce function **Returns** sections #2180

ilg-ul opened this issue Feb 22, 2023 · 8 comments
Labels
enhancement Improved functionality help wanted Contributions are especially encouraged
Milestone

Comments

@ilg-ul
Copy link

ilg-ul commented Feb 22, 2023

Search Terms

@returns

Problem

Functions are rendered with two distinct sections, the first with the content of the @returns tag, and the second with the actual TS type.

Screenshot 2023-02-22 at 17 28 37

Suggested Solution

Coalesce the two sections, and render the @returns content on the next line after the type.

This would also be more consistent with the way parameters are rendered (a bulleted list followed by a paragraph with the description).

@ilg-ul ilg-ul added the enhancement Improved functionality label Feb 22, 2023
@Gerrit0 Gerrit0 added the help wanted Contributions are especially encouraged label Feb 24, 2023
@ilg-ul
Copy link
Author

ilg-ul commented Mar 4, 2023

Any thoughts on this proposal?

If compatibility with older sites is a concern, it can be activated with a configuration option.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Mar 4, 2023

Labeled help wanted to indicate PRs will be gladly accepted, not something that I'm likely to have time to do anytime soon.

@ilg-ul
Copy link
Author

ilg-ul commented Mar 4, 2023

Ok, I'll take a look and possibly prepare a PR.

@ilg-ul
Copy link
Author

ilg-ul commented Mar 8, 2023

@futurGH, what do you think about this proposal, does it make any sense?

@futurGH
Copy link
Contributor

futurGH commented Mar 8, 2023

Definitely makes sense, I'll see if I can take a stab at it before Gerrit0 gets to it 🙂

@ilg-ul
Copy link
Author

ilg-ul commented Mar 8, 2023

Gerrit0 said he will not have time for it anytime soon; I'd be happy to contribute to the project, but I'm not familiar with the internals, and, until I'll get there, your PR will be long ago merged. ;-)

@ilg-ul
Copy link
Author

ilg-ul commented Mar 9, 2023

@futurGH explained me that, with the current implementation, the @returns content is part of a composite with all comments, which are all rendered in a loop, and moving the @returns content after the return type would require filtering out in the current loop, and adding a second loop where only @returns is filtered in, which, I agree, is not exactly an elegant solution.

In this case probably the solution would be to parse @returns into a separate property, and render it separately after the return type. Such a change is not trivial (at least for my current skills), and I have no idea what the implications would be, so I let the project maintainers to suggest a solution.

@ilg-ul
Copy link
Author

ilg-ul commented Apr 21, 2023

Wow! Looking forward to testing the new release.

Thank you!

@Gerrit0 Gerrit0 added this to the v0.24.5 milestone Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improved functionality help wanted Contributions are especially encouraged
Projects
None yet
Development

No branches or pull requests

3 participants