gpt4 book ai didi

java - Eclipse Code Formatter Xml 文档

转载 作者:行者123 更新时间:2023-12-05 05:59:50 26 4
gpt4 key购买 nike

我正在寻找有关 eclipse 代码格式化程序中不同参数的良好文档来源。我在堆栈溢出中找到了一些特定参数的好例子,但找不到任何全面的参数列表或不同间距选项的列表。例如 Google formatter file 中的一项设置是

<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="1040"/>

我已经看到了 16、48、80、81、1040 和 1585 等各种事物的对齐值,但似乎找不到任何具体的例子来说明它们各自的作用。我知道 16 试图将所有内容放在一行上,而 80 也在做同样的事情,但如果发生换行,它会将所有参数移到它们自己的行。

如有任何帮助,我们将不胜感激。

最佳答案

目前,vscode-java 使用 Eclipse Formatter 样式,如 Google Formatter你提到的。

尽管您已经知道为参数对齐分配特定值的设置。还有另一个设置可以控制参数是被包裹在一行中还是保持在不同的行中:

<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="1" />
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>

详细信息请查看Java formatting: Keep lines but fix indentation .

您可以尝试更改计算机上的 google_style.xml 以找到您想要的内容。

关于java - Eclipse Code Formatter Xml 文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67941916/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com