This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS4 code formatting



Hi All,

I am looking for a possible way to activate/enable C++ code formatting (Menu/Edit/Format) in CCS (4.2).

In my Preferences window in General/"C/C++"/Code Formatter the field "Formatters" is currently empty. How could I have something in this box?

 

Kind Regards

Radek

  • Radek,

    To have formatters show up in the list you need to install some additional plug-ins.  I looked around and I found this one: http://sourceforge.net/projects/astyleclipse/  It seems to work ok in CCSv4.2.  I downloaded the zip and dropped the folder into the \ccsv4\eclipse\plugins folder.  Then I see the astyle formatter in the dropdown when I restart CCS.  It also reformats the code when I right click in a source file and click format.  There are probably other plug-ins out there that you can download for different formatting styles.

    I checked CCSv5.1 and the Eclipse/CDT packages we have there include a few different formatters: K&R, BSD/Allman, GNU & Whitesmiths.

    Regards,

    John

  • John,

    Thank you for your help. I have installed astyleeclipse plugin and it seems to work. It is not something that I got used in other tools (like netbeans) but considering the eclipse version CCS uses it is the only current choice. Once again thanks.

    Regards

    Radek