Intellij Seems to have a default layout like this
def foo(int arg) {
label1:
for (i in 1..10) {
label2:
foo(i)
}
}
How do i change it to
def foo(int arg) {
label1:
for (i in 1..10) {
label2:
foo(i)
}
}
This is required since we want out test layouts to look like this:
def 'my test'() {
given:
...
when:
...
then:
...
}
ANSWER: As given below in the answer, I can confirm this works in intellij 13
Press Ctrl+Alt+S to open the IDE settings and select Editor | Code Style. Select the Detect and use existing file indents for editing checkbox. Apply the changes and close the dialog.
If you need to adjust indentation settings, in the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Editor | Code Style. On the appropriate language page, on the Tabs and Indents tab, specify the appropriate indents options and click OK.
Display indent guides To display these lines, open the Settings/Preferences dialog ( ⌘, on macOS or Ctrl+Alt+S on Windows and Linux), go to Appearance and Behavior | Appearance, and enable the Show tree indent guides option.
[Shift] + [Tab] (to move things further left)
In Idea Intellij 13+
Settings -> Editor -> Code Style -> Groovy -> Tabs and Indents
Label indent: 4
Label indent style: Indent statement after label
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With