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

How to disable indentation of enum methods?

user915
1#
user915 Published in July 19, 2018, 9:41 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)

You need to login account before you can post.

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

© 2016 Powered by mzan.com design MATCHINFO