java - 如何防止 Eclipse 格式化程序删除块注释中的“对齐空格”?
问题描述
我们正在使用 google 的“Java 风格”的(略微采用)版本,只需在 eclipse 中导入相应的 XML(来自此处)。
这很好用,但我们看到块注释存在一个烦人的问题。
我们的文件确实有一个生成的版权标题,如下所示:
/* 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 文件,使空格留在块注释中?
解决方案
Eclipse [内置] 样式已关闭“启用标题注释格式”(org.eclipse.jdt.core.formatter.comment.format_header
XML 中的值)。所以它只留下标题注释。
推荐阅读
- angular - 如何确保在路由更改后注入相同的 Angular Service 实例以使服务有状态?
- python-3.x - 运动检测器 GUI
- php - 简单的 PHP 回显不起作用 - 我做错了什么?
- python - 在用户输入中接受逗号和空格
- node.js - 使用 React Hook 加载页面时自动提交表单
- mongodb - 如何将重复的数据点组合成一个数组
- python - 我是网络抓取的初学者 谁能帮我找出问题所在?
- python-3.x - 如何使用 Python 将多个文本文件的内容提取到 pandas 数据框中?
- python - Python -> MySQL:UPDATE SET 未正确更新
- php - php 什么时候准备发送标头?