开发者

Eclipse CDT Source->Implement Method generates code not following defined code style

I am using Sourc开发者_开发技巧e->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.


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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜