FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

`GoogleJavaFormatImportOptimizer`: re-run import format if `document.txt` has changed by facboy · Pull Request #971 · google/google-java-format · GitHub

GoogleJavaFormatImportOptimizer: re-run import format if document.txt has changed - #971

Open
facboy wants to merge 1 commit into
google:masterfrom
facboy:master
Open

GoogleJavaFormatImportOptimizer: re-run import format if document.txt has changed#971
facboy wants to merge 1 commit into
google:masterfrom
facboy:master

Conversation

facboy commented Sep 15, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

This is a follow up to #960 - occasionally the imports are left unformatted and it can be annoying.

…text` has changed

If `document.text` has changed when trying to apply the changes, re-run the import format. This should fix occasional issues with imports not being ordered/formatted correctly after a format operation.
cushon requested a review from plumpy October 2, 2023 20:50
cushon added the IntelliJ label Oct 2, 2023

plumpy commented Oct 9, 2023

Copy link
Copy Markdown
Collaborator

Are you sure this is what's happening? Can you reproduce this?

My plan was that if we detected this case, I would re-trigger the ImportOptimizer, so it would call processFile again (off the Swing thread) and then call the returned runnable back on the Swing thread.

But as far as I can tell IntelliJ already handle that for us. What I see when I try to reproduce this is that IntelliJ is smart and basically if you run "optimize imports" and then change the file before it has a chance to call the returned runnable and make the edit, it knows the file changed, and it will throw that Runnable away and call processFile and start the whole process over again.

So I'm wondering if the behavior you're seeing has a different cause?

facboy commented Oct 9, 2023

Copy link
Copy Markdown
Contributor Author

it's pretty sporadic, i can revert back to the released version and see. anedoctally, i haven't seen it once since i fixed this locally.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL