Provides displaying the Java code as aligned horizontally in columns without actual formatting of the code.
It mainly serves for increasing code readability and reducing tension when reading dozens of tightly placed code lines with different elements.
More formally the plugin provides:
- alignment of consecutive fields, local variables and params in columns of annotations, modifiers, types, names, initializers;
- alignment of consecutive assignments by the equal sign;
- pretty rich set of alignment settings in
File | Settings | Editor | Inlay Hints | Java | Java Code Aligner
.
Please note, that fields alignment is performed only if its modifiers are placed in the canonical order.
From the technical side, plugin works by adding invisible inlay hints (like the ones shown as parameter names for method
calls), which can be made visible via Enable debug mode
in settings above.
Additionally, the plugin provides folding of explicit types to var
and final var
for local variable
declarations, which can be enabled in File | Settings | Editor | General | Code Folding | Java Code Aligner
.
-
Using IDE built-in plugin system:
Settings/Preferences > Plugins > Marketplace > Search for " intellij-java-code-aligner" > Install Plugin
-
Manually:
Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...
Plugin based on the IntelliJ Platform Plugin Template.