14

I am using eclipse Juno with CDT. I have written a function in a cpp file and I want to add comments for the function. Does CDT supports Auto generate comments by "typing /** then press enter"? In my case the auto generated comments are only as follows.

/**
 * 
 */

As explained here, I even configured to use Doxygen support.Go to C/C++ -> Editors -> Documentation Tool Comments: Doxygen.

I still get the comments as mentioned above. How can I configure eclipse to add comments of my own style?

I changed comments even in Code templates. Go to C/C++ -> Code Style -> Code templates -> Comments. I changed Types, Fields, Methods. Still there is no luck for me.

Can someone assist me on this?

Thanks, Ravi

Community
  • 1
  • 1
Ravi
  • 653
  • 3
  • 10
  • 21

3 Answers3

10

If you want the automated filling in of parameters etc, like Eclipse for Java does.

Open your project properties. Then C++ General. Then select Doxygen as your documentation tool. The type /** as you did to get the fully filled comment.

Thirler
  • 20,239
  • 14
  • 63
  • 92
  • Does not work, only /* * */ are inserted. Can you tell me if you have something in C/C++ - Code Style Code Templates - Methods ? – Offler May 10 '17 at 08:24
  • See also @Antonio's link to the generally working solution. That also does work and is even better since it holds for the entire workspace. – Adrian W Aug 29 '17 at 08:34
2

For completeness, since it usually works and there was no feedback about any specific problem of the user asking this question, I would like to point to the generally working solution.

Community
  • 1
  • 1
Antonio
  • 19,451
  • 13
  • 99
  • 197
  • 1
    HI, does also not work for me with choosing doygen. There is a C/C++ - Code Style - Code Templates section and there is /* * */ - that is all what gets inserted. Do you have something else there? – Offler May 10 '17 at 08:27
0

Try to type it just above the function. It shall work. However not sure of the coding template.

bubble
  • 3,408
  • 5
  • 29
  • 51