java - 如何在Java的vs代码中自动跳过另一行而不是自动换行?

问题描述

我在 Java 的 vs 代码中启用了自动换行设置。我意识到它实际上并没有跳过一行:

This is happening.

但我希望所有这些都是不同的行,并且会以这种方式保存:

that way.

这是我的自动换行设置:

Here is my word wrap settings.

这是我的 settigns.json 文件

{
"terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe","files.autoSave": "afterDelay","workbench.colorTheme": "One Dark Pro","python.pythonPath": "C:\\Users\\atleo\\AppData\\Local\\Programs\\Python\\python39\\python.exe","workbench.startupEditor": "newUntitledFile","window.zoomLevel": 0,"C_Cpp.updateChannel": "Insiders","editor.suggestSelection": "first","vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue","python.languageServer": "Pylance","[Log]": {

    "editor.wordWrap": "off"
},"java.configuration.checkProjectSettingsExclusions": false,"python.autoComplete.addBrackets": true,"python.analysis.completeFunctionParens": true,"workbench.editorAssociations": [
    {
        "viewType": "jupyter.notebook.ipynb","filenamePattern": "*.ipynb"
    }
],"editor.rulers": [
    { "column": 80,"color": "#307777"}
],"kite.showWelcomeNotificationOnStartup": false,"java.configuration.runtimes": [

],"[java]": {

    "editor.suggest.snippetsPreventQuickSuggestions": false
},"files.associations": {
    "*.java": "java"
},"java.refactor.renameFromFileExplorer": "autoApply","git.autofetch": true,"editor.wordWrap": "wordWrapColumn","[markdown]": {

    "editor.wordWrap": "on","editor.quickSuggestions": true
},

}

解决方法

此功能将在下次更新时添加,可以Provide better format configuration experience

[更新]

使用最新版本的 java 扩展,您可以从命令面板中实现此功能,然后选择 java: open java formatter settings with preview。详细信息请查看Java on Visual Studio Code Update – May 2021