Fix IntelliJ IDEA project open hang by removing FlutterProjectOpenProcessor#8846
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request addresses a hang in IntelliJ IDEA when opening Flutter projects that lack a .idea directory. The fix involves removing the FlutterProjectOpenProcessor, which was the source of the issue, and relocating its module configuration logic to FlutterInitializer. This is a clean architectural improvement that resolves the hang by letting the platform's default project opener handle the initial project loading, with Flutter-specific setup occurring as a post-startup activity. The changes are correct and consistent with a similar fix previously made for Android Studio.
Note: Security Review did not run due to the size of the PR.
4c8e0c2 to
4ede4d9
Compare
helin24
left a comment
There was a problem hiding this comment.
Thanks for the fix! I appreciate the detailed log of verification testing.
I think this needs a rebase on main but in the meantime I will assign to Phil to review / merge if he approves.
…ectOpenProcessor FlutterProjectOpenProcessor silently failed to open Flutter projects without a .idea directory because getDelegateImportProvider() returned null when no other processor could claim the project. Since this processor was registered with order="first", no fallback occurred. Apply the same fix pattern as PR flutter#8710 (Android Studio): - Remove FlutterProjectOpenProcessor.kt - Remove its <projectOpenProcessor> registration from plugin.xml - Add module-type-fixing logic to FlutterInitializer (startup activity) - Add changelog entry This lets the platform's default project opener handle opening, then FlutterInitializer configures Flutter module type and Dart SDK after the project is loaded. Fixes flutter#8845
810d1e3 to
25659e7
Compare
5b0806f to
93e4e7e
Compare
|
@pq, I think I've made the change to the changelog and also rebased the branch onto main, so everything should be ready to merge now, thanks. |
|
Thank you, @0ttik! |
|
@0ttik I'm going to revert this change for now for the upcoming release. I'm finding that it causes the "open project" dialog to show up twice upon a new project being created. Hopefully we can test and fix that soon after the release. |
…tOpenProcessor (flutter#8846)" This reverts commit 4681015.
#8884) …tOpenProcessor (#8846)" This reverts commit 4681015. The problem is seeing the open project dialog (the one below) twice upon creating a new project. <img width="447" height="165" alt="Screenshot 2026-04-01 at 8 59 27 PM" src="https://github.com/user-attachments/assets/69d08c92-3666-4ef2-87c3-2ff6c4c06aa5" />
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.
Description
The custom
FlutterProjectOpenProcessorsilently fails to open Flutter projects that lack a.ideadirectory in IntelliJ IDEA (Community and Ultimate). WhengetDelegateImportProvider()finds no other processor that can claim the project,openProjectAsync()returnsnull— a silent failure with no error logged. Since this processor is registered withorder="first", no other processor gets a chance to try.This is the IntelliJ IDEA equivalent of PR #8710, which fixed the same class of issue for Android Studio by removing
FlutterStudioProjectOpenProcessor.Changes
FlutterProjectOpenProcessor.ktentirely<projectOpenProcessor>registration fromplugin.xmlFlutterInitializer(the existing IntelliJ IDEA startup activity) — sets Flutter module type and enables Dart SDK for unconfigured modulesThis lets the platform's default project opener handle opening, then
FlutterInitializerconfigures Flutter-specific settings after the project is loaded — the same pattern used in the Android Studio fix.Reproduction
flutter create test_app && rm -rf test_app/.ideaThen open
test_appvia File > Open in IntelliJ IDEA — previously nothing happened, now the project opens correctly.Testing
Tested with:
./gradlew runIde)Verified:
.ideadirectory works in IntelliJ IDEA.ideadirectory still worksrunIde)FlutterInitializerrunning correctly, no errorsFixes #8845
Related: #8661, #8710