1

Ok! I can set rules of formatting by putting an .editorconfig file in the root path of the project. But how can I set the "Editor > Code Style > Java" using this .editorconfig file?

In other words, what I need is to know how to import this file to config the Code Style section.

I need this to updated .editorconfig when necessary.

enter image description here

  • Since your question is about _importing_ the `.editorconfig` file into IntelliJ and the question [How to export all Intellij code styles to a .editorconfig file?](https://stackoverflow.com/q/35915970) is about _exporting_ `.editorconfig`, I concluded that your question is not a duplicate of that other question. | I have changed my mind though, now thinking that this question _is_ a duplicate of the other one. ~ * ~ I might get back to explain why I think so. – Henke Aug 27 '21 at 13:47

2 Answers2

2

you can't. The settings defined in .editorconfig are not visible in the CTRL+ALT+S - Code style. we have just the message "Settings may be overriden by EditorConfig"

1

If you use .editorconfig in project and the Settings (Preferences on macOS) | Editor | Code Style | Enable EditorConfig support option is enabled IDE will take code style options from .editorconfig file (if it exists) instead of from the Editor | Code Style IDE settings.

To see and control the options for Code Style > Java you can by exporting your current IDE Code Style setting to .editorconfig file:

enter image description here

and see and change them under the [*.java] section in the file.

Andrey
  • 15,144
  • 25
  • 91
  • 187
  • 1
    I know how to export an .editorconfig. What I need is to know how to import this file to config the Code Style section. – Samir Ribeiro Jan 21 '21 at 16:26