4
我在一类设置一些注释,并在同一行注解注释,如:如何阻止Eclipse在注释之后移动我的行注释?
@SampleAnnotation // sample comment
@AnotherAnnotation // another comment
public class SampleClass { }
但是,每次我格式化文件时,我同行注释最终被移到下一行。这不仅是不可取的,因为它提出了我的评论,但更糟糕的是,它将评论置于一个令人困惑的地方。上述示例变为:
@SampleAnnotation
// sample comment
@AnotherAnnotation
// another comment
public class SampleClass { }
如何在格式化后停止Eclipse移动这些注释?或者,我如何让Eclipse将注释移动到上面的行,而不是下面的行?谢谢。
不要在第一时间写评论。重点是让方法/注释名称更具可读性。 – adarshr