Skip to content

Fix IntelliJ IDEA project open hang by removing FlutterProjectOpenProcessor#8846

Merged
pq merged 2 commits intoflutter:mainfrom
0ttik:fix/intellij-project-open-processor
Mar 12, 2026
Merged

Fix IntelliJ IDEA project open hang by removing FlutterProjectOpenProcessor#8846
pq merged 2 commits intoflutter:mainfrom
0ttik:fix/intellij-project-open-processor

Conversation

@0ttik
Copy link
Contributor

@0ttik 0ttik commented Mar 9, 2026

Description

The custom FlutterProjectOpenProcessor silently fails to open Flutter projects that lack a .idea directory in IntelliJ IDEA (Community and Ultimate). When getDelegateImportProvider() finds no other processor that can claim the project, openProjectAsync() returns null — a silent failure with no error logged. Since this processor is registered with order="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

  • Removed FlutterProjectOpenProcessor.kt entirely
  • Removed its <projectOpenProcessor> registration from plugin.xml
  • Added module-type-fixing logic to FlutterInitializer (the existing IntelliJ IDEA startup activity) — sets Flutter module type and enables Dart SDK for unconfigured modules
  • Added changelog entry

This lets the platform's default project opener handle opening, then FlutterInitializer configures 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/.idea

Then open test_app via File > Open in IntelliJ IDEA — previously nothing happened, now the project opens correctly.

Testing

Tested with:

  • IntelliJ IDEA CE 2025.2
  • Android Studio 2025.2.3.9 (sandboxed via ./gradlew runIde)
  • Flutter 3.8.1 / Dart 3.8.1
  • macOS

Verified:

  • Opening a Flutter project without .idea directory works in IntelliJ IDEA
  • Opening a Flutter project with existing .idea directory still works
  • No regressions in Android Studio (sandboxed runIde)
  • IDE logs show FlutterInitializer running correctly, no errors

Fixes #8845
Related: #8661, #8710

@google-cla
Copy link

google-cla bot commented Mar 9, 2026

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.

Copy link
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 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.

@0ttik 0ttik force-pushed the fix/intellij-project-open-processor branch from 4c8e0c2 to 4ede4d9 Compare March 9, 2026 21:30
Copy link
Member

@helin24 helin24 left a comment

Choose a reason for hiding this comment

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

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.

@helin24 helin24 requested a review from pq March 11, 2026 18:08
Copy link
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.

If you could make that wee changelog entry, that'd be great. Otherwise, I started our verification workflows and assuming they run green, this LGTM!

…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
@0ttik 0ttik force-pushed the fix/intellij-project-open-processor branch from 810d1e3 to 25659e7 Compare March 11, 2026 23:26
@0ttik 0ttik force-pushed the fix/intellij-project-open-processor branch from 5b0806f to 93e4e7e Compare March 11, 2026 23:31
@0ttik
Copy link
Contributor Author

0ttik commented Mar 11, 2026

@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.

@pq
Copy link
Collaborator

pq commented Mar 12, 2026

Thank you, @0ttik!

@pq pq merged commit 4681015 into flutter:main Mar 12, 2026
7 checks passed
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