palantir / palantir-java-format

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

Intellij plugin: missed newlines on IDE auto-completion #1080

Closed serpro69 closed 2 months ago

serpro69 commented 2 months ago

What happened?

Not sure how to describe it properly, here's a recording:

Kooha-2024-04-30-07-05-53.webm

Kooha-2024-04-30-08-46-43.webm

After updating to latest version of the plugin the other day, I've observed that things like auto-completion, importing things, other "intelligent things where you don't write code but it auto-completes by the IDE" started behaving strangely. E.g. in case of imports, the import would be placed on the same line with an existing import, instead of adding a newline.

I've checked the behavior w/o the palantir formatting enabled - and it works as expected, so it's difinitely an issue in the plugin, and it started happening in the latest version 2.44.0

What did you want to happen?

Newlines should be added properly when IDE auto-completes things. This behavior is quite distracting, requires constant code-reformatting and hence considerably worsens coding experience overall.

AnminSZ commented 2 months ago

I'm having the same problem and I'm really troubled by the situation.

My idea version is : ideaIC-2024.1

CRogers commented 2 months ago

We are aware and currently trying to implement a fix.

CRogers commented 2 months ago

Fix here: https://github.com/palantir/palantir-java-format/pull/1083

CRogers commented 2 months ago

Again, we're waiting for the release with the fix to be approved by jetbrains:

Screenshot 2024-05-02 at 17 12 36

ash211 commented 2 months ago

Thanks for the quick fix! I've built and installed the latest version locally (instead of waiting for the JetBrains review), and this seems fixed.

I opened a PR with instructions for how to do that at https://github.com/palantir/palantir-java-format/pull/1084

crogoz commented 2 months ago

The version 2.46.0 with the fix was approved by jetbrains: https://plugins.jetbrains.com/plugin/13180-palantir-java-format/versions/stable/531366