Skip to content

Support direction (or "['dir']") optional attribute of Doxygen \param #5773

Open

Description

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

Activity

  1. BillDenton commented on Jul 14, 2020

    @BillDenton

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

  2. changed the title [-] Support "['dir']" optional attribute of Doxygen \param[/-] [+] Support direction (or "['dir']") optional attribute of Doxygen \param[/+] on Jul 14, 2020
  3. aschlicht commented on Aug 14, 2020

    @aschlicht

    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

  4. Colengms commented on Oct 22, 2020

    @Colengms
    Contributor

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

  5. added this to the 1.2.0 milestone on Oct 22, 2020
  6. Colengms commented on Oct 22, 2020

    @Colengms
    Contributor

    Hi Aaron (@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

  7. michelleangela commented on Nov 11, 2020

    @michelleangela
    ContributorAuthor

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

  8. bcaddy commented on Nov 11, 2020

    @bcaddy

    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

  9. michelleangela commented on Nov 11, 2020

    @michelleangela
    ContributorAuthor

    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

  10. bcaddy commented on Nov 11, 2020

    @bcaddy

    Thank you!

  11. aschlicht commented on Nov 12, 2020

    @aschlicht

    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

  12. JohanBertrand commented on Aug 14, 2023

    @JohanBertrand

    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 !

  13. sean-mcmanus commented on Aug 14, 2023

    @sean-mcmanus
    Contributor

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

  14. michelleangela commented on Aug 14, 2023

    @michelleangela
    ContributorAuthor
  15. wouter-heerwegh commented on Dec 18, 2023

    @wouter-heerwegh

    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

  16. clee-ai commented on Feb 13, 2024

    @clee-ai

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions