我们使用的是来自google的(稍微采用的)版本的"Java style“,只需在eclipse (从here)中导入相应的XML即可。
这很好用,但我们看到块注释有一个恼人的问题。
我们的文件确实有一个生成的copyright标头,如下所示:
/* some text followed by some spaces */
/* so that all lines are equally spaced */
在使用google样式的xml时,上面的代码变成
/* some text followed by some spaces */
/* so that all lines are equally spaced */
当使用Eclipse [built-in]
格式化程序格式化时,空格不会被删除!
我仔细检查了google XML文件,发现了下面这一行:
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" false="true"/>
但是,将该行更改为使用false
并不会改变任何内容。
问:如何修改google风格的XML文件,使空格保留在块注释中?
发布于 2019-05-21 09:39:20
Eclipse内置样式关闭了“Enable header comment formatting”(XML值为org.eclipse.jdt.core.formatter.comment.format_header
)。因此,它将标题注释留在原处。
https://stackoverflow.com/questions/56235253
复制相似问题