21.1.0 #274
abashev
announced in
Announcements
21.1.0
#274
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The IntelliJ IDEA plugin now formats inside the IDE and optimizes imports with open-java-format. The output differs from 21.0.2 in a few narrow cases, so take this release with one reformatting run, in a commit of its own.
IntelliJ IDEA plugin
Reformat Code and Optimize Imports run the formatter inside the IDE's own JVM, with no process to start, and take milliseconds where a file used to take up to a second. The IDE's Java then decides which syntax parses: Java 21 in IntelliJ IDEA 2024.2, Java 25 in 2026.3. For newer syntax, choose In a separate JVM with a newer JDK under Run the formatter in the plugin's settings, next to Native binary; a project that used the native binary keeps it.
Optimize Imports, and everything that runs it, such as Actions on Save, now removes and sorts imports as the command line does. Imports the IDE inserts follow the same layout.
Formatter
A line comment that starts with a no-break space or another Unicode space keeps it, and a long string literal under a cast, a qualified
.newor a method reference no longer fails the whole file. A misplaced Unicode escape and a stray;between imports fail with an error at their line. With theformatJavadocoption, a comment loses the<p>tags at its end, and a<div>gets no<p>in front of it.Command line, build plugins and Eclipse
Formatting ranges leaves the imports alone and reflows long strings only in the code it rewrites, the same on the command line, in
formatDiff, in Eclipse and in IntelliJ IDEA. The Maven plugin and the Spotless step now write what the command line writes, andformatDiffno longer fails on a diff larger than 64 KB.Library
Formatter.getFormatReplacements,Input.getPositionTokenMapandSnippetFormatter.formatreturnjava.util.Listand Guava'sRangeMapinstead ofImmutableListandImmutableRangeMap, so code that calls them has to be compiled again.Thanks
To Liam Miller-Cushon of google-java-format, whose three fixes are ported here, and to joaonsk203 and doomfrawen, whose pull requests to google-java-format, #1526 and #1534, proposed the two Javadoc changes.
This discussion was created from the release 21.1.0.
All reactions