Skip to content

IntelliJ IDEA configuration

Yevhenii Nadtochii edited this page Nov 3, 2022 · 2 revisions

Table of contents

Configure .proto File Type

You can create custom file types to enable parsing these files in the editor by defining highlighting schemes for keywords, comments, numbers, and so on.
To configure how IntelliJ IDEA treats a .proto file:

  1. Download a configuration file.
  2. Move it to IntelliJ IDEA config directory and restart the IDE.
For Windows:
<SYSTEM DRIVE>\Users\<USER ACCOUNT NAME>\.<PRODUCT><VERSION>\config\filetypes
For Mac OS X:
~/Library/Preferences/<PRODUCT><VERSION>/filetypes
For Linux and the Other UNIX Systems:
~/.<PRODUCT><VERSION>/config/filetypes

Where PRODUCT is IntelliJIdea or IdeaIC, VERSION is IntelliJ IDEA version (14, 15, and so on).

Live Templates

The templates are available for the repeated patterns. They are located in config repository under .idea/live-templates directory. They are not picked up by IDEA automatically and should be installed manually. Follow the instruction left in README.md file along with the templates.

Automatic configuration updates

All Spine projects use the same code style settings, inspection profiles, and so on. Updating these files manually after making changes to the project is time-consuming. To solve the problem and update the required file automatically, use the following script: core-java/config/update-spine-config

The script usage

If you want to update configuration for SpineEventEngine/tools:

  1. Copy the core-java/config/update-spine-config.sh or *.bat to .../IdeaProjects/tools/config.
  2. Optionally change the list of files which you want to update. By default, it updates .idea/ configuration and the contents of scripts/ folder.
  3. Execute the script, which does the following:
    1. Replaces files by the corresponding ones from core-java.
    2. If there are differences after the replacement, executes the following steps. 2.1 Creates a new branch. 2.2 Creates a commit with the updated files. 2.3 Pushes the commit.
  4. Manually create a new pull request for these changes.

Enable Error-Prone Plugin

Installing the Plug-in

  1. Start IntelliJ IDEA and open the Plugins dialog.
  2. Click the Browse repositories button and choose the Build category.
  3. Find the Error-prone Compiler Integration plugin area.
  4. Right-click and choose Download and install. The IDE will restart after you close the dialogs.

Selecting a Compiler

  1. In IntelliJ IDEA, open the Settings dialog or Preferences dialog in Mac OSx.
  2. Select Compiler | Java Compiler | Use compiler: Javac with error-prone.
  3. Make sure that Compiler | Use external build is NOT selected.

Exclude generated files

In a Compiler | Java Compiler dialog, add the following option to the Additional command line parameters field:

-XepExcludedPaths:.*/generated/.*

Clone this wiki locally