vscode-cpptools
vscode-cpptools copied to clipboard
Support direction (or "['dir']") optional attribute of Doxygen \param
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].
Ensure "[in.out"] and not having "[dir]" is supported.
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.
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.
Another example with "in" and "out" with keyword color. I like keyword color better.
Taking this out of tracking, as the tracked VS issue appears to have been fixed.
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
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".
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
@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
Thank you!
I open an issue in the cpp-textmate-grammer repo, as suggested in other comments, for [in] and [out] syntax coloring. https://github.com/jeff-hykin/cpp-textmate-grammar/issues/520
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:
Could it be fixed within the scope of this issue, or should I create a new one?
Thank you !
@JohanBertrand Not sure -- if it's fixed we could create a new issue to track it.
@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.
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
Is this feature dependent on Visual Studio fixing the ticket linked above, or is there a path forward within VScode?