AI Assistant "write documentation" feature and comment formatting

Below is some documentation generated by the AI Assistant. How can I prevent the * from beginning each line? (This is very old-fashioned, IMHO.)

/**
* @brief Deletes a dynamically allocated object.
*
* This function deletes the object pointed to by the given pointer.
* It is a utility function to ensure proper deletion of objects.
*
* @tparam T The type of the object to be deleted.
* @param object Pointer to the object to be deleted.
*/

0
3 comments

Hello,

We have a setting for the style of documentation comments on the “Code generation” settings page, but AI Assistant currently doesn't use it. I've filed https://youtrack.jetbrains.com/issue/RSCPP-36196/

Could you please explain what you mean by “old-fashioned”? In our experience C++ documentation comments either follow this style with each line prefixed by ‘*’ in a multi-line ‘/** … */’ comment, or each line is prefixed by ‘///’. How exactly do you format documentation comments, could you please show an example?

0

Could you please explain what you mean by “old-fashioned”?

I don't mind the use of /** to start a comment since it's compatible with Doxygen, but I personally prefer using /*! The asterisks at the beginning of each line aren't necessary and only add unnecessary cognitive load. I referred to it as "old-fashioned" because this is the type of comment I used to see in C code over 30 years ago 😉
The following is what I consider better, taking my previous comment's example:

/*!
 @brief Deletes a dynamically allocated object.

 This function deletes the object pointed to by the given pointer.
 It is a utility function to ensure proper deletion of objects.

 @tparam T The type of the object to be deleted.
 @param object Pointer to the object to be deleted.
*/

Aside from this, the asterisks can be used as bullet points in a long comment. This clashes with comments that start each line with an asterisk.

0

Thanks!

We haven't encountered this comment style a lot, but I've filed a feature request to track this - https://youtrack.jetbrains.com/issue/RSCPP-36202/

0

Please sign in to leave a comment.