The code style options are categorized in the following categories: Under this last option, there’s a code style scheme for different file types, but we will just look for the Java ones. The options for formatting the code are defined in “ File/ Settings/Editor/Code Style”. Let’s see how we can custom the formatting settings. It has just formatted it following the default options, which may not be suitable for everyone. Note that IntelliJ IDEA hasn’t asked us how it should format the code. ![]() So, if we use the shortcut for example, Bar.java, it will look now like: The most easy way to reformat the code is with the shortcut: Ctrl + Alt + L (or also Ctrl + Windows Key + Alt + L, useful for Linux users that have the Ctrl + Alt + L shortcut for locking the screen. For example, we could create a couple of dummy classes like the following:īar.java package įoo.java package
0 Comments
Leave a Reply. |