简体   繁体   中英

How to change intellij Java IDE automatic formatting of code behaviour ?

This is the output of reformat code option from intellij (alt + command + L)

int i = Main.someRandomFuntion("arg1", 
                    "arg2", 
                    "arg3", "arg4", 
                    someRandomFunction2("arg1", 
                            "arg2"), 
                    "arg6");

and what i need this is

int i = Main.someRandomFuntion("arg1",
                               "arg2",
                               "arg3", "arg4",
                               someRandomFunction2("arg1",
                                                   "arg2"),
                               "arg6");

which is just more an aesthetic improvement.

Do intellij (I am using 15) support an option to tweak auto format option ?, if so How can i do it ?

Open Settings with Ctrl + Alt + S .

Go to:

Editor > Code Style > Java

Click on the Wrapping and Braces tab, scroll down to Method declaration parameters and change the settings there to what you desire.


Note : I found these particular Settings a little glitchy when I was toggling them but you can usually get what you want with a couple of minutes of fiddling and testing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM