Skip to content

Describe Optimize Imports and the three ways to run the formatter in IntelliJ IDEA - #17

Merged
abashev merged 2 commits into
mainfrom
abashev/intellij-optimize-imports-and-run-modes
Nov 25, 2026
Merged

abashev merged 2 commits into
mainfrom
abashev/intellij-optimize-imports-and-run-modes

Conversation

@abashev

@abashev abashev commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

From 21.1.0 the IntelliJ plugin optimizes imports with open-java-format and formats inside the IDE's JVM by default, with a separate JVM or the native binary to choose instead (openjavaformat/open-java-format#255, openjavaformat/open-java-format#259, openjavaformat/open-java-format#267). The page said that Reformat Code alone ran the formatter, that it ran in a process of its own, and that Use native binary, a box the settings page no longer has, switched the binary on.

  • Imports, new: where Optimize Imports runs, the layout of the imports the IDE adds while the plugin is enabled, an .editorconfig that wins over it, and "Optimize imports on the fly", which from IntelliJ IDEA 2025.2 never reaches the plugin.
  • How the formatter runs, new: In the IDE process, In a separate JVM with its JDK list, and Native binary; Active formatter; and what becomes of a project's earlier choice.
  • Format on save ticks Optimize imports too, and Native binary is chosen under Run the formatter rather than ticked.

Screenshots

PNG, shown at half their size, as before. The two WebP screenshots go.

  • intellij-enable.png, retaken: the settings page with Enable open-java-format ticked and In the IDE process chosen.
  • intellij-actions-on-save.png, retaken: Actions on Save with Reformat code and Optimize imports ticked.
  • intellij-code-style.png, new: Editor → Code Style, with "Settings may be overridden by open-java-format" and Disable at the top.
  • intellij-separate-jvm.png, new: the settings page with In a separate JVM chosen and the JDK list open, the JDKs older than Java 21 in grey.

zensical build --clean --strict reports no issues.

…IntelliJ IDEA

From 21.1.0 the plugin optimizes imports with open-java-format and
formats inside the IDE's JVM by default, with a separate JVM or the
native binary to choose instead (open-java-format#255, #259 and #267).
The page said that Reformat Code alone ran it, that the formatter ran
in a process of its own, and that Use native binary, a box the
settings page no longer has, switched the binary on.

- Imports: where Optimize Imports runs, the layout of the imports the
  IDE adds, EditorConfig, and on the fly from 2025.2.
- How the formatter runs: the three ways, Active formatter, and what
  becomes of a project's earlier choice.
- Format on save ticks Optimize imports too, and the native binary is
  chosen as one of the three ways.

The screenshots of the settings page and of Actions on Save are to be
retaken, and two are new: the Java code style page with its note, and
the JDK list of a separate JVM.
…e Style

PNG in place of the two WebP screenshots of the settings page and
Actions on Save, which showed Use native binary and no Optimize
imports, and two new ones: the Code Style page with its note and the
JDK list of a separate JVM. Each is shown at half its size, as before.
The note is on the Code Style page itself, so the page says so.
@abashev
abashev merged commit 14c8e0a into main Nov 25, 2026
2 checks passed
@abashev
abashev deleted the abashev/intellij-optimize-imports-and-run-modes branch November 25, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant