Home How to disable indentation of enum methods?
Reply: 0

How to disable indentation of enum methods?

user5742
1#
user5742 Published in September 19, 2018, 11:03 am

Given:

public enum Test
{
    ONE
    {
        public String toString()
        {
            return "foo";
        }
    },
    TWO
    {
        public String toString()
        {
            return "bar";
        }
    }
}

IntelliJ IDEA 2018.1 is indenting the braces containing the methods as follows:

public enum Test
{
    ONE
        {
            public String toString()
            {
                return "foo";
            }
        },
    TWO
        {
            public String toString()
            {
                return "bar";
            }
        }
}

I could not find any code-formatting setting to change this behavior. Is there a way to keep the braces on the same indentation level as the enum constants?

(I do not wish to change the continuation indentation for non-enum code)

share|improve this question
  • 1
    youtrack.jetbrains.com/issue/IDEA-106353 – CrazyCoder Apr 17 at 7:02

1 Answer 1

active oldest votes
up vote 0 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.401965 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO