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! |
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