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 direction (or "['dir']") optional attribute of Doxygen \param #5773

Open
michelleangela opened this issue Jul 13, 2020 · 14 comments
Open
Labels
Feature: Doc comments An issue related to code comments shown in hover, completion, and signature help. Feature Request Language Service
Milestone

Comments

@michelleangela
Copy link
Contributor

michelleangela commented Jul 13, 2020

Feature requested on Visual Studio at https://developercommunity.visualstudio.com/t/support-dir-optional-attribute-of-doxygen-param/1112281

Feature details:
This is a feature request to support parsing of the direction (or ‘[‘dir’]’) optional attribute of the Doxygen command \param '[‘dir’]'

Information about the direction or “dir” attribute:
https://www.doxygen.nl/manual/commands.html#cmdparam

Example:

/*!
 * Copies bytes from a source memory area to a destination memory area,
 * where both areas may not overlap.
 * @param[out] dest The memory area to copy to.
 * @param[in]  src  The memory area to copy from.
 * @param[in]  n    The number of bytes to copy
 */
void memcpy(void *dest, const void *src, size_t n);

If ‘[‘dir’]’ is supported, the hover info of the memcpy would show which param are [in] and which are [out].

@michelleangela michelleangela added Language Service Feature Request Visual Studio Inherited from Visual Studio Feature: Doc comments An issue related to code comments shown in hover, completion, and signature help. labels Jul 13, 2020
@michelleangela michelleangela added this to the Tracking milestone Jul 13, 2020
@BillDenton
Copy link

Ensure "[in.out"] and not having "[dir]" is supported.

@michelleangela michelleangela changed the title Support "['dir']" optional attribute of Doxygen \param Support direction (or "['dir']") optional attribute of Doxygen \param Jul 14, 2020
@aschlicht
Copy link

aschlicht commented Aug 14, 2020

I also would like support for the doxygen direction attributes. I'd like the hover info support as well as syntax coloring. Notice how the doxygen commented parameters are the same color as the function parameters when [in] and [out] are not present. I'd like to see the same coloring when [in] and [out] are present.

image

Here is a suggestion for how the syntax coloring could look with [in] and [out]. (I created it with mspaint.) "in" and "out" could be keyword color, variable / parameter color, or another color.
image

Another example with "in" and "out" with keyword color. I like keyword color better.
image

@Colengms
Copy link
Contributor

Taking this out of tracking, as the tracked VS issue appears to have been fixed.

@Colengms Colengms removed this from the Tracking milestone Oct 22, 2020
@Colengms Colengms removed the Visual Studio Inherited from Visual Studio label Oct 22, 2020
@bobbrow bobbrow added this to the 1.2.0 milestone Oct 22, 2020
@Colengms
Copy link
Contributor

Hi @aschlicht Regarding colorization; The C/C++ Extension provides colorization for semantic tokens, but syntax based colorization is provided by VS Code via it's TextMate grammar for C/C++. Given that the colorization you are referring to is in comments, it would be coming from VS Code. You might consider opening an issue in the repo for the C/C++ TextMate grammar used by VS Code, which is here: https://github.com/jeff-hykin/cpp-textmate-grammar

@michelleangela
Copy link
Contributor Author

michelleangela commented Nov 11, 2020

It turns out the feedback ticket to support direction ['dir'] attribute on the Visual Studio side was unintentionally set to complete. The support has not been implemented yet. The feedback ticket status was reset to "under review".

@michelleangela michelleangela modified the milestones: 1.2.0, Tracking Nov 11, 2020
@bcaddy
Copy link

bcaddy commented Nov 11, 2020

I'm also having this issue with syntax highlighting. As you can see in the attached image highlighting works great without ['dir'] but when I add it in the syntax highlighting goes away
86406616-718b9e80-bc81-11ea-98fc-4e31408c3d9b

@michelleangela
Copy link
Contributor Author

@bcaddy
Colorization in comments is determined by VS Code via it's C++ TextMate grammar and is not determined by the C++ Extension (vscode-cpptools). You might consider opening an issue in the repo for the C++ TextMate grammar used by VS Code, which is here: https://github.com/jeff-hykin/cpp-textmate-grammar

@bcaddy
Copy link

bcaddy commented Nov 11, 2020

Thank you!

@aschlicht
Copy link

I open an issue in the cpp-textmate-grammer repo, as suggested in other comments, for [in] and [out] syntax coloring.
jeff-hykin/better-cpp-syntax#520

@JohanBertrand
Copy link

JohanBertrand commented Aug 14, 2023

Hi, is there still something in development for this feature ?

There is still a bug happening with the hover info when the attribute is not directly declared after param

For example:

/**
 * @brief Check content of the uint8_t variable
 *
 * @param [in ] input Variable to check
 */
void
checkUint8(uint8_t const input);

Generates the following hover info:
image

Could it be fixed within the scope of this issue, or should I create a new one?

Thank you !

@sean-mcmanus
Copy link
Contributor

@JohanBertrand Not sure -- if it's fixed we could create a new issue to track it.

@michelleangela
Copy link
Contributor Author

@JohanBertrand the link to the original Visual Studio feedback got updated. I updated the link to https://developercommunity.visualstudio.com/t/support-dir-optional-attribute-of-doxygen-param/1112281.

@michelleangela michelleangela removed their assignment Oct 25, 2023
@wouter-heerwegh
Copy link

wouter-heerwegh commented Dec 18, 2023

Are there still plans to roll out this feature, even when used correctly, i.e. param[in] a, it does not seem to provide any additional information when hovering over a function

@CCInc
Copy link

CCInc commented Feb 13, 2024

Is this feature dependent on Visual Studio fixing the ticket linked above, or is there a path forward within VScode?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Doc comments An issue related to code comments shown in hover, completion, and signature help. Feature Request Language Service
Projects
None yet
Development

No branches or pull requests

10 participants