palantir / palantir-java-format

A modern, lambda-friendly, 120 character Java formatter.
Apache License 2.0
403 stars 43 forks source link

Excessive import optimization in intellij #1088

Open jguerra opened 1 month ago

jguerra commented 1 month ago

What happened?

I'm running version 2.46.0 of the plugin with intellij 2024.1.1

With the latest version of the plugin intellij sometimes gets in a state where every key press triggers an optimize imports/reformat. For example, when writing a javadoc every keypress causes intellij to optimize imports. The other scenario I've noticed is hitting enter in outside a method in a java source file triggers a reformat/optimize imports - immediately removing the new line I just added. For both of these scenarios I've been temporarily disabling the plugin until I'm done doing work, and then re-enabling to format.

I'll add an update if I'm able to figure out what triggers the excessive optimization behavior to start, as it doesn't always occur.

What did you want to happen?

Less frequent reformats and optimizations. Ideally the reformats could occur on save

yotamshtosselfg commented 1 month ago

Looks like #954 and: https://youtrack.jetbrains.com/issue/IDEA-353203/Intellij-optimize-imports-action-changes-formatting-of-text-blocks

ash211 commented 1 month ago

I've also seen the reformat code dialogue flash every time I switch between two terminal tabs

Screenshot 2024-05-29 at 5 15 48 PM