Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Version published after converting to the new editor

...

Info

All images and settings shown in the following sections were taken on IntelliJ version: IDEA 2016.3.4 (and 2019.3.2 on MacOS)

If you update the documentation please update the IntelliJ version as well!

Anchor
intellij-code-format
intellij-code-format
Java Code Format

...

 1. Install Eclipse Code Formatter plugin in intelliJ | Go to Files -> Settings -> Plugins | Select Marketplace and search for Eclipse Code Formatter, then install it and restart your IntelliJ

...

. For mac OS  go to IntellijIDEA -> Preferences -> Plugins

Image Added

2. Get OpenMRS Formatter XML file

3. Go to Files -> Settings -> Other Settings -> Eclipse Code Formatter |  The configuration must look like

...

this

Image Added

  • Turn on the Eclipse Code Formatter
  • Import the previously downloaded XML file
  • Turn off the option for Optimizing Imports

...

Open the IntelliJ preferences like you did when you configured the formatter intellij-code-format

We are using the the Eclipse defaults eclipse-imports which are different from IntelliJ's!

...

If your class already has a Logger instance just place the cursor to where you want to log and type logd (for debug), logi (for info), ... hit Control+Space (for the context menu) select the template and hit enter. Depending on what template you are using you might need to only enter your log message or also add a parameter after the message like for example for logpe (for logging an error and passing it an exception) or logpi (to log an info message using the slf4j parametrized message style like log.info("the temperatur was {}", temperatureObject) ).

...