Eclipse auto-formatter, disable auto line-wrapping of comment lines

我与影子孤独终老i 提交于 2019-12-03 04:24:05

I think that the thing you are specifically asking about you can achieve by editing your formatter:

  • Window -> Preferences -> Java -> Code Style -> Formatter. There edit you click on Edit...
  • If you are using the default Eclipse formatter you will need to edit the profile name (you cna not edit built in profile).
  • Go to comments
  • Deselect line comment formatting.

That way no formatting of comments of the type // will be done.

This annoys me also. To fix the wrapped comments you can use the keyboard shortcut CTL+ALT+J to join the comments onto one line. The comment-indicator characters (// or *) will still be there but at least it will save you some steps. Then you can just run a find and replace for the comment-indicators.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!