Title: IntelliJ plugin formats code between formatter off/on marker comments · Issue #215 · openjavaformat/open-java-format · GitHub
Open Graph Title: IntelliJ plugin formats code between formatter off/on marker comments · Issue #215 · openjavaformat/open-java-format
X Title: IntelliJ plugin formats code between formatter off/on marker comments · Issue #215 · openjavaformat/open-java-format
Description: Upstream: palantir#1303 Kind: bug | Priority: low 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 ...
Open Graph Description: Upstream: palantir#1303 Kind: bug | Priority: low palantir-java-format#1303 (open since May 2025) reports that the IntelliJ plugin reformats code wrapped in the IDE's "formatter off / formatter on"...
X Description: Upstream: palantir#1303 Kind: bug | Priority: low palantir-java-format#1303 (open since May 2025) reports that the IntelliJ plugin reformats code wrapped in the IDE's "formatter off / form...
Opengraph URL: https://github.com/openjavaformat/open-java-format/issues/215
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"IntelliJ plugin formats code between formatter off/on marker comments","articleBody":"**Upstream:** https://github.com/palantir/palantir-java-format/issues/1303 \n**Kind:** bug | **Priority:** low\n\n[palantir-java-format#1303](https://github.com/palantir/palantir-java-format/issues/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.\n\nWhy 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.\n\nAffected 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.\n\nExamples: 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.\n\nSuggested 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).\n\n---\n_Filed from an upstream-watch ticket after manual review._","author":{"url":"https://github.com/abashev","@type":"Person","name":"abashev"},"datePublished":"2026-11-12T12:01:25Z","url":"https://github.com/openjavaformat/open-java-format/issues/215"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5dff035f-8592-af45-38ff-2d8f26f2eedb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A5E:3451AC:972F2:D20DF:6AFBB797 |
| html-safe-nonce | c8d49245c8fb17616032984d2dc89f7ff36361ba8b473bf742661972d723f8d5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTVFOjM0NTFBQzo5NzJGMjpEMjBERjo2QUZCQjc5NyIsInZpc2l0b3JfaWQiOiIyNDUzNTIwMzk3NzE1MDkzNDAwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | efe47f304e605a20943522c40b2cc29af869b1c972f94e02158a9346fe31abe8 |
| hovercard-subject-tag | issue:6349345980 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/openjavaformat/open-java-format/215/issue_layout |
| twitter:image | https://opengraph.githubassets.com/57194bb41e37ecdbaa186b5dc2778395e1bda74430ec2baea79d0d660ded0310/openjavaformat/open-java-format/issues/215 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/57194bb41e37ecdbaa186b5dc2778395e1bda74430ec2baea79d0d660ded0310/openjavaformat/open-java-format/issues/215 |
| og:image:alt | Upstream: palantir#1303 Kind: bug | Priority: low palantir-java-format#1303 (open since May 2025) reports that the IntelliJ plugin reformats code wrapped in the IDE's "formatter off / formatter on"... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | abashev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c |
| turbo-cache-control | no-preview |
| go-import | github.com/openjavaformat/open-java-format git https://github.com/openjavaformat/open-java-format.git |
| octolytics-dimension-user_id | 325177626 |
| octolytics-dimension-user_login | openjavaformat |
| octolytics-dimension-repository_id | 1288055459 |
| octolytics-dimension-repository_nwo | openjavaformat/open-java-format |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 214273098 |
| octolytics-dimension-repository_parent_nwo | palantir/palantir-java-format |
| octolytics-dimension-repository_network_root_id | 214273098 |
| octolytics-dimension-repository_network_root_nwo | palantir/palantir-java-format |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e4cce0e99cf61481a318ff12c2e8580153a6c7c6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width