3

I've been attempting to get my Intellij IDEA to confirm to a google-like Java standard - however both imports and manual settings seem to be ignored.

Here's how my indentations are currently set: sceenshot

However my code still formats at 4 spaces, and when I reformat it goes to 4 spaces as well.

Thanks in advance!

Mathieson
  • 1,698
  • 2
  • 17
  • 19
  • This is an old question, JFTR: The issue could be related to using .editorconfig file, which overrides IDE and project code-style settings. – Farshid Zaker Sep 06 '19 at 11:59

1 Answers1

1

This is the setting for your GoogleStyle scheme. But your project most likely doesn't use it. It's not enough to just select it in the combobox. You need to import this scheme into your project.

Click Manage... and Copy to Project, and it should work as expected.

Also, make sure you're setting language-spefic settings, so instead Code Style select Code Style > Java.

Darek Kay
  • 15,827
  • 7
  • 64
  • 61
  • 1
    Hmmm, I've tried that - however even when I review that the indentation is 2, and then format, I get indented to 4 spaces. Seems something else is missing. – Mathieson May 05 '15 at 16:26
  • You've probably set the generic indent size (`Code Style`). It is overriden by the more specific indent size. Look under `Code Style > Java` – Darek Kay May 05 '15 at 17:21