palantir / palantir/palantir-java-format

Formatter is run when IntelliJ loses focus and file is unchanged

Open
#1,092 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
907
Forks
101
Avg merge
1d 3h
Merged PRs (30d)
19

Description

What happened?

Starting with IntelliJ v2024.1.2 (this didn't happen with v2024.1.1), when my IntelliJ window loses focus (i.e. due to alt-tab) this plugin is running on files that haven't changed. This causes the files to be re-saved, frequently giving me a dialog box that disk and in-memory changes are conflicting even though they aren't.

In case it matters, I'm on a MacBook Pro M2 running macOS Sonoma v14.4.1.

What did you want to happen?

The plugin should not run when IntelliJ loses focus and no files have been changed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with IntelliJ 2024.1.2 by switching focus while files are unchanged, then inspect the plugin's handling of focus and file changes. Done means focus loss alone no longer runs or re-saves files, while formatting still occurs after a file is changed.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.