Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333134 - Make auto-generated doxygen comments configurable
Summary: Make auto-generated doxygen comments configurable
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 8.0   Edit
Hardware: All All
: P3 enhancement with 20 votes (vote)
Target Milestone: 9.11.0   Edit
Assignee: Marco Stornelli CLA
QA Contact: Doug Schaefer CLA
URL:
Whiteboard:
Keywords:
: 539093 (view as bug list)
Depends on:
Blocks: 552334
  Show dependency tree
 
Reported: 2010-12-23 04:37 EST by Pieter Smith CLA
Modified: 2020-01-15 08:31 EST (History)
13 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pieter Smith CLA 2010-12-23 04:37:11 EST
Build Identifier: 20100917-0705

Make auto-generated doxygen templates configurable (E.g. under C/C++ -> Code Style -> Code Templates)

Eclipse auto-generates the following comment block when typing /** for example:
/**
 * |                <- cursor here
 * @param first_parm
 * @return
 */
int new_function(int first_parm) {
}

Ideally the generated block should be fully customizable for all comment block types so that the following can be generated:
/**
 * <Mandatory: Describe in 1 sentence>		<- text pre-selected
 * <Optional: Detail description or omit>
 * @pre <Mandatory: Describe or '-' if none>
 * @param[in,out] first_parm <Optional: Describe or omit>
 * @return <Mandatory: Describe>
 */
int new_function(int first_parm) {
}

Minimally, the mandatory doxygen commands should be specifiable for all comment block types:
/**
 * |               <- cursor here
 * @pre
 * @param[in,out] first_parm
 * @return
 */
int new_function(int first_parm) {
}

NOTE: This is NOT a duplicate of Bug 238764, where Thomas Gern only requested c++-Style comments to be added.

Reproducible: Always
Comment 1 Daniel Neuberger CLA 2012-03-07 12:04:26 EST
I'm pretty sure this should be part of this bug, but the format of the block should be customizable as well.  So users should be able to customize the style they're using to any of the following or evening something else:

JavaDoc style:
/**
 * |                <- cursor here
 * @param first_parm
 * @return
 */
int new_function(int first_parm) {
}

Another:
/********************************************//**
 * |                <- cursor here
 * \param first_parm
 * \return
 ***********************************************/
int new_function(int first_parm) {
}

Another style:
/**
 |                <- cursor here
 @param first_parm
 @return
 */
int new_function(int first_parm) {
}

Another style:
/// |                <- cursor here
/// \param first_parm
/// \return
int new_function(int first_parm) {
}

Another:
/***********************************************/
/// |                <- cursor here
/// @param first_parm
/// @return
///*********************************************/
int new_function(int first_parm) {
}

Details on acceptable doxygen comment styles are here http://www.stack.nl/~dimitri/doxygen/docblocks.html.

I would recommend as much flexibility as possible.  At a minimum, I think have the ability to use \ instead of @ as the delimiter for starting special commands.

If this needs to be a separate bug, please let me know.

Thanks.

- Daniel
Comment 2 Marco Stornelli CLA 2020-01-06 12:53:31 EST
I'm working on doxygen improvement in Cdt. I plan to add several options to fine tune the behavior:

1) Use structured commands, @class, @struct and so on;
2) Use javadoc style for tags '@' or '\'
3) Use different style for enums like //< or /**< and so on
4) Use always @brief or not
5) If brief is enabled, an option for a new line or not after for detailed description
6) Generate always @pre or not

Currently CDT already support /*! or /// or /** or //! as trigger to generate doxygen documentation. With options listed above the support should be better. For the current internal architecture using a code template is not really easy. In JDT Javadoc is built-in and in the code template the user can use ${tags} but we haven't anything similar in CDT, Doxygen is just an "hook" over the management of a general multiline comment.
Comment 3 Eclipse Genie CLA 2020-01-10 15:05:18 EST
New Gerrit change created: https://git.eclipse.org/r/155626
Comment 4 Alexander Fedorov CLA 2020-01-11 15:02:41 EST
(In reply to Eclipse Genie from comment #3)
> New Gerrit change created: https://git.eclipse.org/r/155626

Another Gerrit is planned to further improve the https://git.eclipse.org/r/155626
Comment 5 Marco Stornelli CLA 2020-01-12 10:57:04 EST
*** Bug 539093 has been marked as a duplicate of this bug. ***
Comment 7 Marco Stornelli CLA 2020-01-14 12:00:34 EST
(In reply to Alexander Fedorov from comment #4)
> (In reply to Eclipse Genie from comment #3)
> > New Gerrit change created: https://git.eclipse.org/r/155626
> 
> Another Gerrit is planned to further improve the
> https://git.eclipse.org/r/155626

I wait for your commit to close this bug.
Comment 8 Eclipse Genie CLA 2020-01-14 13:25:09 EST
New Gerrit change created: https://git.eclipse.org/r/155872
Comment 9 Alexander Fedorov CLA 2020-01-14 13:33:29 EST
(In reply to Eclipse Genie from comment #8)
> New Gerrit change created: https://git.eclipse.org/r/155872

I suggest to postpone other improvements to other tickets, already created Bug 559066 and Bug 559067 . 
It will be good also to make preference constants private for DoxygenPreferences class - actually they are a part of implementation and should not be exposed to the clients.
Comment 11 Marco Stornelli CLA 2020-01-15 08:31:13 EST
According to Alexander's comment, I close this bug. Other problems about Doxygen support is already tracked by other bug reports. Thanks to Alexander for all the support.