File tree Expand file tree Collapse file tree 3 files changed +14
-15
lines changed
Expand file tree Collapse file tree 3 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -57,16 +57,16 @@ class FlutterStudioProjectOpenProcessor : FlutterProjectOpenProcessor() {
5757 return newProject
5858 }
5959
60- writeAction {
61- for ( module in FlutterModuleUtils .getModules(newProject )) {
62- if ( FlutterModuleUtils .declaresFlutter(module) && ! FlutterModuleUtils .isFlutterModule(module)) {
60+ for (module in FlutterModuleUtils .getModules(newProject)) {
61+ if ( FlutterModuleUtils .declaresFlutter( module) && ! FlutterModuleUtils .isFlutterModule(module )) {
62+ writeAction {
6363 FlutterModuleUtils .setFlutterModuleType(module)
64- FlutterModuleUtils .enableDartSDK(module)
6564 }
65+ FlutterModuleUtils .enableDartSDK(module)
6666 }
67- newProject.save()
68- EditorNotifications .getInstance(newProject).updateAllNotifications()
6967 }
68+ newProject.save()
69+ EditorNotifications .getInstance(newProject).updateAllNotifications()
7070
7171 return newProject
7272 }
Original file line number Diff line number Diff line change @@ -67,9 +67,7 @@ open class FlutterProjectOpenProcessor : ProjectOpenProcessor() {
6767 if (project == null || project.isDisposed) return project
6868
6969 // Convert any modules that use Flutter but don't have IntelliJ Flutter metadata.
70- writeAction {
71- convertToFlutterProject(project)
72- }
70+ convertToFlutterProject(project)
7371
7472 return project
7573 }
Original file line number Diff line number Diff line change @@ -375,13 +375,14 @@ public static void setFlutterModuleType(@NotNull Module module) {
375375
376376 public static void setFlutterModuleAndReload (@ NotNull Module module , @ NotNull Project project ) {
377377 if (project .isDisposed ()) return ;
378+ ApplicationManager .getApplication ().invokeLater (() -> {
379+ ApplicationManager .getApplication ().runWriteAction (() -> setFlutterModuleType (module ));
380+ enableDartSDK (module );
381+ project .save ();
378382
379- setFlutterModuleType (module );
380- enableDartSDK (module );
381- project .save ();
382-
383- EditorNotifications .getInstance (project ).updateAllNotifications ();
384- ProjectManager .getInstance ().reloadProject (project );
383+ EditorNotifications .getInstance (project ).updateAllNotifications ();
384+ ProjectManager .getInstance ().reloadProject (project );
385+ });
385386 }
386387
387388 public static void enableDartSDK (final @ NotNull Module module ) {
You can’t perform that action at this time.
0 commit comments