Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Built-in Code Formatter

You are right, there was no built-in code formatter before.
I know of 2 plug-ins implementing a code formatter for CDT:

Simple Indent
(http://softwitch.net/blog/index.php/simple-indent-110-has-been-released
/) and
Astyle (http://sourceforge.net/projects/astyleclipse/)

Note, that Simple Indent requires to have the Astyle 
executable installed on your system, while the other is
self-contained and plain Java.

After installing one of these plug-ins, you also need to
choose the formatter on the CDT code formatter preference page.

Hope this helps.
Please ask such questions on the newsgroup, next time.

Regards,
Toni

> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of jingzhao.ou
> Sent: Friday, November 10, 2006 5:29 PM
> To: CDT General developers list.
> Subject: Re: [cdt-dev] Built-in Code Formatter
>
> Dear all,
>
> I am new to the Eclispe CDT. Every thing looks very cool. The only
> pity is that the Code Formatter does not seem to work. I was
> suspecting if my Eclipse needs some more configuration to make it
> work. However, judging from this email, it seems that the Code
> Formatter is actually not implemented. Am I right? If this is the
> case, can any one tell me how to set up Eclipse to use external
> Formatter?
>
> Thanks a lot!
>
> Best regards,
> Jingzhao
>
> On 11/10/06, Leherbauer, Anton <Anton.Leherbauer@xxxxxxxxxxxxx> wrote:
> > Hi,
> >
> > I have committed an initial version of a built-in C/C++
> code formatter
> > (bug 95274).
> >
> > Following predefined formatting profiles are available:
> > - K&R
> > - BSD/Allman
> > - GNU
> > - Whitesmiths
> > (See also http://en.wikipedia.org/wiki/Indent_style)
> >
> > The output of the built-in formatter depends on the quality
> of the AST
> > that can be obtained from the source code. Although, some
> heuristic is
> > used to handle syntax errors and other parsing problems,
> the result may
> > be other than expected. It may also happen, that the
> formatter runs into
> > an unrecoverable problem and simply leaves the source code
> unmodified.
> >
> > With the tracing option "org.eclipse.cdt.core/debug/formatter=true"
> > you can get more details in case of formatter problems.
> > The trace output would be esp. helpful when attached to a
> bug report.
> >
> > Thanks,
> > Toni
> > _______________________________________________
> > cdt-dev mailing list
> > cdt-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
> >
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 



Back to the top