Vscode eclipse 格式化程序设置以对齐方法参数

Vscode eclipse formatter setting to align method parameters

vscode中的哪个eclipse-formatter设置会完成下面的格式化,特别关注参数对齐?

当前

    public ResponseEntity retrieveAgreement(final String one, final Long someId,
            final Long anotherId, final Long otherPAram) {
        // Omitted
    }

需要

    public ResponseEntity retrieveAgreement(final String one, 
                                            final Long someId,
                                            final Long anotherId, 
                                            final Long otherParam) {
        // Omitted
    }

关于Java格式化,可以参考Formatting and Linting.

下载 GoogleStyle.xml 并编辑以下设置:

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

然后在vscodesettings.json中设置

"java.format.settings.url": "<local path to java-google-style.xml>",

您可以保留您想要的格式化样式,而不是将参数格式化为一行: