Skip to content
Advertisement

Eclipse — Add Space After Square Bracket (Formatter)

What I am looking for is very similar to what can be found here: Eclipse: Adding Spaces to Parentheses

However, I also need to do this for square brackets.

For example:

array[index] => array[ index ]

Thank you in advance.

Advertisement

Answer

It can be done as in the referenced answer but on Whitespace -> Arrays section.
Remember to work on a copy of the built-in formatter using the New button for backup purposes .

enter image description here

Eclipse IDE for Enterprise Java and Web Developers (includes Incubating components)
Version: 2021-06 (4.20.0)
Build id: 20210612-2011
Java version: 11.0.11

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement