Repository navigation
Describe Optimize Imports and the three ways to run the formatter in IntelliJ IDEA - #17
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
.editorconfigthat wins over it, and "Optimize imports on the fly", which from IntelliJ IDEA 2025.2 never reaches the plugin.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 --strictreports no issues.