Home > Blockchain >  intellij formating inconsistant
intellij formating inconsistant

Time:01-31

Hy, it's not a big issue, but anyway :

All my other coworker code is auto-formated like that :

        output = output.update(
                par1,
                par2
        );

mine is autoformated like that:

       output = output.update(
            par1,
            par2
        );

more specificaly : the tabulation for their parameters method have 2x 4 space, mine have 1x4 spaces

any idea which how to change this codestyle rules? We use a common formater file, but somehow, I don't have the same things than everyone else.

Edit : It's java code, I need the name of the rules who manage that

CodePudding user response:

This is almost certainly down to the settings in Intellij's Editor preferences.

Open the settings panel and search for code format or open the Editor > Code Style > Java options.

Intellij IDEA settings for Code Style

The preview on the right side is live-updated, so if you change settings on the left, they will be reflected on the right.

Please note that not all options are available for all languages and it's often a matter of playing a bit with it.

An alternative is that your coworkers can EXPORT the settings they are using and you can import them.

They would export it by tapping the "gear" (?) next to the Scheme:

Image of a Menu popup showing export options for the code style settings

You can then Import them by using the "import Scheme" option ;)

  • Related