You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IntelliJ plugin formats code between formatter off/on marker comments #215
palantir-java-format#1303 (open since May 2025) reports that the IntelliJ plugin reformats code wrapped in the IDE's "formatter off / formatter on" marker comments, even when that option is enabled in the IDE code-style settings. IntelliJ's own formatter honours the markers, so users who switch to the plugin lose a feature they relied on; the reporter's example is a long Spring Security builder chain that is meant to stay hand-laid-out. A new comment (2026-11-11) only points to how spring-javaformat documents the same use case.
Why it matters to us: our IDEA plugin is a fork of the same code. It registers as an external async formatting service, takes the formatting ranges from the IDE request and passes them straight to the formatter (see the range handling in PalantirJavaFormatFormattingService). I found no code in the plugin, or in the core formatter, that looks at marker comments or excludes the regions between them, so the same behaviour should apply to our users. Not verified by running the plugin.
Affected files in our repo: open-java-format-idea-plugin/src/main/java/com/palantir/javaformat/intellij/PalantirJavaFormatFormattingService.java (range computation, toRanges), and possibly the core formatter in open-java-format if the exclusion is implemented there so that CLI, Gradle and native users benefit as well.
Examples: not available - the issue gives only the input code and a description of the wrong result; it does not show what the formatter outputs, and the fix is not in the item.
Suggested action: investigate. Reproduce with our plugin, then decide whether to subtract the marker regions from the requested ranges in the plugin (smallest change) or add marker support to the core formatter. Low priority: the upstream issue has no fix or linked PR, and a workaround exists (select ranges manually).
Filed from an upstream-watch ticket after manual review.
Activity