7
7
8
8
//import static com.android.tools.idea.gradle.project.importing.GradleProjectImporter.ANDROID_PROJECT_TYPE;
9
9
10
- import static com .intellij .util .ReflectionUtil .findAssignableField ;
11
- import static io .flutter .actions .AttachDebuggerAction .ATTACH_IS_ACTIVE ;
12
- import static io .flutter .actions .AttachDebuggerAction .findRunConfig ;
13
-
14
10
import com .android .tools .idea .gradle .project .sync .GradleSyncListener ;
15
11
import com .android .tools .idea .gradle .project .sync .GradleSyncState ;
16
12
import com .intellij .debugger .engine .DebugProcess ;
22
18
import com .intellij .openapi .application .Application ;
23
19
import com .intellij .openapi .application .ApplicationManager ;
24
20
import com .intellij .openapi .module .Module ;
25
- import com .intellij .openapi .project .*;
21
+ import com .intellij .openapi .project .ModuleListener ;
22
+ import com .intellij .openapi .project .Project ;
23
+ import com .intellij .openapi .project .ProjectType ;
24
+ import com .intellij .openapi .project .ProjectTypeService ;
26
25
import com .intellij .util .ThreeState ;
27
26
import com .intellij .util .concurrency .AppExecutorUtil ;
28
27
import com .intellij .util .messages .MessageBusConnection ;
29
28
import com .intellij .util .messages .Topic ;
30
29
import io .flutter .FlutterUtils ;
31
30
import io .flutter .actions .AttachDebuggerAction ;
31
+ import io .flutter .dart .FlutterDartAnalysisServer ;
32
32
import io .flutter .pub .PubRoot ;
33
33
import io .flutter .run .SdkAttachConfig ;
34
34
import io .flutter .sdk .FlutterSdk ;
35
+ import org .jetbrains .annotations .NonNls ;
36
+ import org .jetbrains .annotations .NotNull ;
37
+ import org .jetbrains .annotations .Nullable ;
35
38
36
39
import java .lang .reflect .Field ;
37
40
import java .lang .reflect .Modifier ;
38
41
import java .util .Collection ;
39
42
import java .util .List ;
40
43
41
- import org . jetbrains . annotations . NonNls ;
42
- import org . jetbrains . annotations . NotNull ;
43
- import org . jetbrains . annotations . Nullable ;
44
+ import static com . intellij . util . ReflectionUtil . findAssignableField ;
45
+ import static io . flutter . actions . AttachDebuggerAction . ATTACH_IS_ACTIVE ;
46
+ import static io . flutter . actions . AttachDebuggerAction . findRunConfig ;
44
47
45
48
public class AddToAppUtils {
46
49
//private static final Logger LOG = Logger.getInstance(AddToAppUtils.class);
@@ -49,7 +52,7 @@ private AddToAppUtils() {
49
52
}
50
53
51
54
public static boolean initializeAndDetectFlutter (@ NotNull Project project ) {
52
- MessageBusConnection connection = project .getMessageBus ().connect (project );
55
+ MessageBusConnection connection = project .getMessageBus ().connect (FlutterDartAnalysisServer . getInstance ( project ) );
53
56
// GRADLE_SYNC_TOPIC is not public in Android Studio 3.5. It is in 3.6. It isn't defined in 3.4.
54
57
//noinspection unchecked
55
58
Topic <GradleSyncListener > topic = getStaticFieldValue (GradleSyncState .class , Topic .class , "GRADLE_SYNC_TOPIC" );
@@ -71,7 +74,6 @@ public void modulesAdded(@NotNull Project proj, @NotNull List<? extends Module>
71
74
});
72
75
}
73
76
}
74
-
75
77
}
76
78
});
77
79
return false ;
0 commit comments