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

Support in/out parameter tags #533

Closed
PlasmaHH opened this issue Mar 9, 2023 · 3 comments · Fixed by #557
Closed

Support in/out parameter tags #533

PlasmaHH opened this issue Mar 9, 2023 · 3 comments · Fixed by #557
Labels
feature New feature or request good first issue Good for newcomers

Comments

@PlasmaHH
Copy link

PlasmaHH commented Mar 9, 2023

Doxygen supports in/out tags for parameters like

/**
 * \brief some function
 * \param[in] p1 first param
 * \param[out] p2 second param
 */
void some_function( int p1, int& p2 );

This could be activated with an option and each in/out could be a point to be cycled through with tabs. The defaults at least for C++ could depend on whether the parameter is a non-const ref or pointer.

@kkoomen kkoomen added feature New feature or request good first issue Good for newcomers labels May 1, 2023
kkoomen added a commit that referenced this issue May 1, 2023
…-param-tags

feat(c,cpp): add in-out direction docblock param jumps (closes #533)
@kkoomen
Copy link
Owner

kkoomen commented May 1, 2023

Hi!

This is something I haven't noticed myself, but this is a good suggestion to improve overall documentation. I've implemented this for C and C++ when using doxygen. I've made it into a jumpable TODO like so:

/**
 * @brief [TODO:summary]
 *
 * @param[[TODO:direction]] p1 [TODO:description]
 * @param[[TODO:direction]] p2 [TODO:description]
 */
void some_function( int p1, int& p2 );

This way, developers can always add it or remove it. In the end, it would be better to specify it as much as possible, hence I've made included it in the default docblock being generated.

Side note: I see that you do use \param. I just resolved #534 for you as well. Thank you for making these two issues as separate issues, I appreciate it.

@kkoomen
Copy link
Owner

kkoomen commented May 1, 2023

This feature has been merged and released in v3.20.0.

Feel free to submit any new issues if you experience any unwanted behaviour in the future. Thanks for your contribution.

@PlasmaHH
Copy link
Author

Very nice, since I always use them this works just fine for me.

I was wondering though if some people might not like it and then hit del to remove the TODO:direction part but then are left with empty [] ... They might want those to vanish then too... Not sure if its possible to implement there... ( I know ultisnips supports something similar, which is why I had the idea that someone in the future might want it easier to remove the empty [] )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants