Skip to content

Fix IDEA project open hang#8903

Merged
helin24 merged 8 commits intoflutter:mainfrom
helin24:idea-open
Apr 16, 2026
Merged

Fix IDEA project open hang#8903
helin24 merged 8 commits intoflutter:mainfrom
helin24:idea-open

Conversation

@helin24
Copy link
Copy Markdown
Member

@helin24 helin24 commented Apr 14, 2026

Fixes #8845.

Follows up on #8846 which I reverted before the last release because it was causing new projects to prompt the user to open twice (at least in my environment). The change I made since then is to not reload after setting up the modules.

The risk of not reloading is that there could be things that don't recognize the new module identity e.g., tool windows or DAS may not start properly. I checked that those two things aren't an issue, so I feel like this is reasonable and better than being prompted twice to open a new project.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a silent failure when opening Flutter projects without a .idea directory in IntelliJ IDEA by removing the FlutterProjectOpenProcessor and migrating the configuration logic to FlutterInitializer. Feedback focuses on optimizing the new initialization logic, specifically by merging redundant module loops to avoid duplicate SDK enablement and addressing performance concerns related to nested asynchronous tasks and frequent UI/IO updates during module configuration.

Comment thread src/io/flutter/FlutterInitializer.java Outdated
Comment thread src/io/flutter/utils/FlutterModuleUtils.java
@helin24
Copy link
Copy Markdown
Member Author

helin24 commented Apr 14, 2026

@gemini-code-assist review again?

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates Flutter project configuration logic from FlutterProjectOpenProcessor to FlutterInitializer to prevent silent failures when opening projects without a .idea directory. The changes include refactoring FlutterModuleUtils to support module configuration without a full project reload and introducing a mechanism to identify and fix unconfigured Flutter modules during startup. Review feedback highlights critical threading violations where heavy I/O operations, specifically project.save() and SDK path lookups, are performed on the Event Dispatch Thread (EDT), which could lead to UI freezes.

Comment thread src/io/flutter/utils/FlutterModuleUtils.java
Comment thread src/io/flutter/FlutterInitializer.java Outdated
@helin24 helin24 requested a review from pq April 14, 2026 21:38
Copy link
Copy Markdown
Collaborator

@pq pq left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@helin24 helin24 merged commit e965bb8 into flutter:main Apr 16, 2026
8 checks passed
@helin24 helin24 deleted the idea-open branch April 16, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FlutterProjectOpenProcessor silently fails to open projects without .idea directory in IntelliJ IDEA

3 participants