Vscode-cpptools: Support direction (or "['dir']") optional attribute of Doxygen \param

Created on 13 Jul 2020  ·  9Comments  ·  Source: microsoft/vscode-cpptools

Feature requested on Visual Studio at https://developercommunity.visualstudio.com/content/problem/1111522/support-dir-optional-attribute-of-doxygen-param.html.

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].

Feature Request Doc comments Language Service

Most helpful comment

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

All 9 comments

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.

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

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
86406616-718b9e80-bc81-11ea-98fc-4e31408c3d9b

@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

Was this page helpful?
0 / 5 - 0 ratings