18
18
import com .intellij .openapi .application .ApplicationManager ;
19
19
import com .intellij .openapi .application .ModalityState ;
20
20
import com .intellij .openapi .application .ReadAction ;
21
- import com .intellij .openapi .diagnostic .Logger ;
22
21
import com .intellij .openapi .editor .colors .EditorColorsListener ;
23
22
import com .intellij .openapi .editor .colors .EditorColorsManager ;
24
23
import com .intellij .openapi .extensions .PluginId ;
41
40
import io .flutter .devtools .RemainingDevToolsViewFactory ;
42
41
import io .flutter .editor .FlutterSaveActionsManager ;
43
42
import io .flutter .logging .FlutterConsoleLogManager ;
44
- import io .flutter .logging .PluginLogger ;
45
43
import io .flutter .module .FlutterModuleBuilder ;
46
44
import io .flutter .pub .PubRoot ;
47
45
import io .flutter .pub .PubRoots ;
58
56
import io .flutter .utils .OpenApiUtils ;
59
57
import io .flutter .view .InspectorViewFactory ;
60
58
import org .jetbrains .annotations .NotNull ;
61
- import org .jetbrains .annotations .Nullable ;
62
59
63
60
import java .util .ArrayList ;
64
61
import java .util .List ;
75
72
* may run when a project is being imported.
76
73
*/
77
74
public class FlutterInitializer extends FlutterProjectActivity {
78
- private static final @ NotNull Logger LOG = PluginLogger .createLogger (FlutterInitializer .class );
79
75
private boolean toolWindowsInitialized = false ;
80
76
81
77
private boolean busSubscribed = false ;
@@ -84,7 +80,7 @@ public class FlutterInitializer extends FlutterProjectActivity {
84
80
85
81
@ Override
86
82
public void executeProjectStartup (@ NotNull Project project ) {
87
- LOG .info ("Executing Flutter plugin startup for project: " + project .getName ());
83
+ log () .info ("Executing Flutter plugin startup for project: " + project .getName ());
88
84
// Disable the 'Migrate Project to Gradle' notification.
89
85
FlutterUtils .disableGradleProjectMigrationNotification (project );
90
86
@@ -109,7 +105,7 @@ public void executeProjectStartup(@NotNull Project project) {
109
105
continue ;
110
106
}
111
107
112
- LOG .info ("Flutter module has been found for project: " + project .getName ());
108
+ log () .info ("Flutter module has been found for project: " + project .getName ());
113
109
// Ensure SDKs are configured; needed for clean module import.
114
110
FlutterModuleUtils .enableDartSDK (module );
115
111
@@ -130,7 +126,6 @@ public void executeProjectStartup(@NotNull Project project) {
130
126
}
131
127
}
132
128
133
-
134
129
// Lambdas need final vars.
135
130
boolean finalHasFlutterModule = hasFlutterModule ;
136
131
ReadAction .nonBlocking (() -> {
@@ -283,29 +278,29 @@ private void sendThemeChangedEvent(@NotNull Project project) {
283
278
final DtdUtils dtdUtils = new DtdUtils ();
284
279
final DartToolingDaemonService dtdService = dtdUtils .readyDtdService (project ).get ();
285
280
if (dtdService == null ) {
286
- LOG .error ("Unable to send theme changed event because DTD service is null" );
281
+ log () .error ("Unable to send theme changed event because DTD service is null" );
287
282
return ;
288
283
}
289
284
290
285
dtdService .sendRequest ("postEvent" , params , false , object -> {
291
286
JsonObject result = object .getAsJsonObject ("result" );
292
287
if (result == null ) {
293
- LOG .error ("Theme changed event returned null result" );
288
+ log () .error ("Theme changed event returned null result" );
294
289
return ;
295
290
}
296
291
JsonPrimitive type = result .getAsJsonPrimitive ("type" );
297
292
if (type == null ) {
298
- LOG .error ("Theme changed event result type is null" );
293
+ log () .error ("Theme changed event result type is null" );
299
294
return ;
300
295
}
301
296
if (!"Success" .equals (type .getAsString ())) {
302
- LOG .error ("Theme changed event result: " + type .getAsString ());
297
+ log () .error ("Theme changed event result: " + type .getAsString ());
303
298
}
304
299
}
305
300
);
306
301
}
307
302
catch (WebSocketException | InterruptedException | ExecutionException e ) {
308
- LOG .error ("Unable to send theme changed event" , e );
303
+ log () .error ("Unable to send theme changed event" , e );
309
304
}
310
305
}, 1 , TimeUnit .SECONDS );
311
306
}
0 commit comments