如何通过 .editorconfig 文件从 Intellij 设置 "Editor > Code Style > Java" 参数?

How to set "Editor > Code Style > Java" parameters from Intellij by .editorconfig file?

好的!我可以通过在项目的根路径中放置一个 .editorconfig 文件来设置格式规则。但是如何使用这个 .editorconfig 文件设置 "Editor > Code Style > Java"

换句话说,我需要知道如何导入这个文件来配置代码样式部分。

我需要在必要时更新 .editorconfig

如果您在项目和设置(macOS 上的首选项)中使用 .editorconfig |编辑|代码风格 | 启用 EditorConfig 支持 选项已启用 IDE 将从 .editorconfig 文件(如果存在)而不是编辑器中获取代码样式选项 | 代码风格 IDE 设置。

要查看和控制 Code Style > Java 的选项,您可以将当前的 IDE 代码样式设置导出到 .editorconfig 文件:

并在文件的 [*.java] 部分下查看和更改它们。

你不能。 .editorconfig 中定义的设置在 CTRL+ALT+S - 代码样式中不可见。 我们刚刚收到消息 “设置可能会被 EditorConfig 覆盖”