Importing APEX Code Style in IntelliJ
With IntelliJ you can either import settings globally for all the workspaces or apply the style to a specific project.
##Import settings globally To share settings between all the workspaces you can import the apex-style.jar
which contains the apex-style. This file can be found under the .settings sub-folder in this folder.
####To import the settings from the jar archive
- On the main menu, choose File | Import Settings.
- In the Import File Location dialog box that opens select the
apex-style.jar
. - The Select Components to Import dialog box that opens next will only have an entry for code style which by default is selected. Click on OK.
- Restart IntelliJ once the jar is successfully imported.
####To apply APEX code style
- On the main menu, choose IntelliJ | Preferences.
- Go to Editor | Code Style.
- In the ‘Scheme’ drop down select ‘apex-style’.
##Apply settings to a specific project
- There is a .idea folder under the Apex project which contains a codeStyleSettings.xml that describes APEX style.
- On the main menu of IntelliJ, choose IntelliJ | Preferences.
- Go to Editor | Code Style.
- In the ‘Scheme’ drop down select ‘Project’.