2010-05-11 54 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