2010-05-11 53 views
0

我遇到了日食格式化程序,我似乎无法弄清楚的问题。无法弄清楚如何正确配置eclipse格式化器

如果我有意见的代码行是超过80个字符,如:

Something something = new Something(somethingElse) // some comments here about the code. 

然后我第一次运行格式化,它将正确设置它,如:

Something something = new Something(somethingElse) // some comments here 
                // about the code. 

但是,如果我再稍后重新格式化,将其更改为:

Something something = new Something(somethingElse) // some comments here 
// about the code. 

我觉得像重新应该是这里我很想念的东西,但我已经浏览了所有可以找到的格式化程序设置,并且尚未找到防止此行为的方法。有没有人有这方面的见解?

感谢

回答

0

格式化运行第二次,它不明白// about the code就行注释的一部分之上,它决定该行需要与代码平齐。仔细查看设置,我没有看到明显的解决方法。我建议要么只是在行尾添加简短评论和/或将评论放在上面的行中。 (或者,不使用格式化程序,这通常是我的偏好。)

// some comments here about the code. If it's long enough it'll wrap 
// like this. 
Something something = new Something(somethingElse) // Short note