@@ -50,7 +50,7 @@ class Driver {
5050 }
5151 if (checkIfChangesShouldBeApplied (result)) {
5252 for (SourceFileEdit fileEdit in result.edits) {
53- final file = new File (fileEdit.file);
53+ final file = File (fileEdit.file);
5454 String code = file.existsSync () ? file.readAsStringSync () : '' ;
5555 code = SourceEdit .applySequence (code, fileEdit.edits);
5656 await file.writeAsString (code);
@@ -80,7 +80,7 @@ class Driver {
8080 /// server being run and return `true` if they are.
8181 /// Display an error message and return `false` if not.
8282 bool checkIfSelectedOptionsAreSupported (Options options) {
83- if (handler.serverProtocolVersion.compareTo (new Version (1 , 22 , 2 )) >= 0 ) {
83+ if (handler.serverProtocolVersion.compareTo (Version (1 , 22 , 2 )) >= 0 ) {
8484 return true ;
8585 }
8686 if (options.excludeFixes.isNotEmpty) {
@@ -108,7 +108,7 @@ class Driver {
108108 logger.trace ('Requesting fixes' );
109109 Future isAnalysisComplete = handler.analysisComplete ();
110110
111- final params = new EditDartfixParams (options.targets);
111+ final params = EditDartfixParams (options.targets);
112112 if (options.excludeFixes.isNotEmpty) {
113113 params.excludedFixes = options.excludeFixes;
114114 }
@@ -128,18 +128,18 @@ class Driver {
128128 await isAnalysisComplete;
129129
130130 progress.finish (showTiming: true );
131- ResponseDecoder decoder = new ResponseDecoder (null );
131+ ResponseDecoder decoder = ResponseDecoder (null );
132132 return EditDartfixResult .fromJson (decoder, 'result' , json);
133133 }
134134
135135 void showDescriptions (String title, List <DartFixSuggestion > suggestions) {
136136 if (suggestions.isNotEmpty) {
137137 logger.stdout ('' );
138138 logger.stdout (ansi.emphasized ('$title :' ));
139- List <DartFixSuggestion > sorted = new List .from (suggestions)
139+ List <DartFixSuggestion > sorted = List .from (suggestions)
140140 ..sort (compareSuggestions);
141141 for (DartFixSuggestion suggestion in sorted) {
142- final msg = new StringBuffer ();
142+ final msg = StringBuffer ();
143143 msg.write (' ${toSentenceFragment (suggestion .description )}' );
144144 final loc = suggestion.location;
145145 if (loc != null ) {
@@ -179,12 +179,12 @@ Analysis Details:
179179
180180 Future <EditGetDartfixInfoResult > showFixes ({Progress progress}) async {
181181 Map <String , dynamic > json = await server.send (
182- EDIT_REQUEST_GET_DARTFIX_INFO , new EditGetDartfixInfoParams ().toJson ());
182+ EDIT_REQUEST_GET_DARTFIX_INFO , EditGetDartfixInfoParams ().toJson ());
183183 progress? .finish (showTiming: true );
184- ResponseDecoder decoder = new ResponseDecoder (null );
184+ ResponseDecoder decoder = ResponseDecoder (null );
185185 final result = EditGetDartfixInfoResult .fromJson (decoder, 'result' , json);
186186
187- final fixes = new List <DartFix >.from (result.fixes)
187+ final fixes = List <DartFix >.from (result.fixes)
188188 ..sort ((f1, f2) => f1.name.compareTo (f2.name));
189189
190190 logger.stdout ('''
@@ -216,8 +216,8 @@ These fixes are NOT automatically applied, but may be enabled using --$includeOp
216216 targets = options.targets;
217217 context = testContext ?? options.context;
218218 logger = testLogger ?? options.logger;
219- server = new Server (listener: new _Listener (logger));
220- handler = new _Handler (this );
219+ server = Server (listener: _Listener (logger));
220+ handler = _Handler (this );
221221
222222 // Start showing progress before we start the analysis server.
223223 Progress progress;
@@ -291,10 +291,10 @@ analysis server
291291 logger.trace ('' );
292292 logger.trace ('Setup analysis' );
293293 await server.send (SERVER_REQUEST_SET_SUBSCRIPTIONS ,
294- new ServerSetSubscriptionsParams ([ServerService .STATUS ]).toJson ());
294+ ServerSetSubscriptionsParams ([ServerService .STATUS ]).toJson ());
295295 await server.send (
296296 ANALYSIS_REQUEST_SET_ANALYSIS_ROOTS ,
297- new AnalysisSetAnalysisRootsParams (
297+ AnalysisSetAnalysisRootsParams (
298298 options.targets,
299299 const [],
300300 ).toJson ());
0 commit comments