Oma*_*eji 23 eclipse comments code-formatting
有没有办法阻止eclipse修改源文件中的注释?
我的主要问题是阻止它包装它们.我已经设法将eclipse配置为不对任何代码进行自动换行,但它似乎仍然可以用于评论.
我输入的代码如下:
public int myVariable = 100; // this variable is a very interesting variable and it does lots of stuff
Run Code Online (Sandbox Code Playgroud)
最终像这样:
public int myVariable = 100; // this variable
// is a very
// interesting
// variable and
// it does lots
// of stuff
Run Code Online (Sandbox Code Playgroud)
小智 70
您可以使用另一种解决方案来抑制特定块注释的格式.在块注释的开头使用/* - (注意连字符),如果格式化文件的其余部分,格式不会受到影响.
/*- * Here is a block comment with some very special * formatting that I want indent(1) to ignore. * * one * two * three */
资料来源:http://www.oracle.com/technetwork/java/javase/documentation/codeconventions-141999.html#680
Jon*_*and 15
转到"窗口"菜单 - >首选项
从左侧列表中选择您感兴趣的编辑器(例如Java),
然后应该有一个名为"代码样式"的子部分,并在"格式化程序"下.
然后,您需要创建一个新的格式化程序配置文件.(无法编辑内置配置文件)在配置文件配置的最后一个选项卡上是注释格式的选项
| 归档时间: |
|
| 查看次数: |
9009 次 |
| 最近记录: |