views:

68

answers:

1

I am using Source->Implement Method sometimes, but I noticed that the generated code does not follow the defined code style from the preferences (the style is applied when I use Source->Format correctly) - Is there some setting I missed or is that a bug?

Using Eclipse Version 3.5.2 and CDT 6.0.2 on Ubuntu Linux 10.04 LTS.

Example: we defined the opening { to be on the same line as the class/method definition, but Implement Method puts it on the following line.

+1  A: 

Hello,

I just tried, and I do not encounter this issue (I am using Eclipse 3.3, 3.4 and 3.6).

I don't know if you are aware of this Eclipse feature, but in Preferences > Java > Editor > Save actions, you can define the list of actions that are automatically run when you save the Java class you are currently editing.

The interesting elements in this panel are the Format source code as well as the Organize imports actions.


Edit regarding the comments:

This problem seems to be related to the Eclipse CDT plugin which does not offer the save actions feature. I just had a look on CDT version 7.0 and this feature has not been added unfortunately.

So I suggest that you log a bug in their Bugzilla instance to report the problem you encounter with the Impement method feature. Eventually, you can also log an enhancement to add this Save actions in this plugin!

romaintaz
Are you sure you are talking about the C++ editor? That Save actions thing is not triggered when editing C++ files, and the C++ Save actions do not have a "Format source code" option.
brandstaetter
@brandstaetter Oh, indeed, I was only talking about Java code. I do not use Eclipse for C++ development. So it seems to be a problem with the `CDT` plugin...
romaintaz
Too bad. I hope someone here uses CDT and can help me.
brandstaetter
I had hoped that it was a problem on my side, not a bug/missing feature. I'll bugzilla it...
brandstaetter