@@ -26,12 +26,12 @@ final class FixInFileProcessor {
2626 FixInFileProcessor (this ._fixContext, {this .alreadyCalculated});
2727
2828 Future <List <Fix >> compute () async {
29- var error = _fixContext.error ;
29+ var diagnostic = _fixContext.diagnostic ;
3030
31- var generators = _getGenerators (error .diagnosticCode);
31+ var generators = _getGenerators (diagnostic .diagnosticCode);
3232
3333 String getAlreadyCalculatedValue (ProducerGenerator generator) {
34- return '${generator .hashCode }|${error .diagnosticCode .name }' ;
34+ return '${generator .hashCode }|${diagnostic .diagnosticCode .name }' ;
3535 }
3636
3737 // Remove generators for which we've already calculated and we were asked to
@@ -48,7 +48,7 @@ final class FixInFileProcessor {
4848 }
4949
5050 var diagnostics = _fixContext.unitResult.diagnostics
51- .where ((e) => error .diagnosticCode.name == e.diagnosticCode.name);
51+ .where ((e) => diagnostic .diagnosticCode.name == e.diagnosticCode.name);
5252 if (diagnostics.length < 2 ) {
5353 return const < Fix > [];
5454 }
@@ -68,28 +68,28 @@ final class FixInFileProcessor {
6868 workspace: _fixContext.workspace,
6969 libraryResult: _fixContext.libraryResult,
7070 unitResult: _fixContext.unitResult,
71- error: error ,
71+ error: diagnostic ,
7272 correctionUtils: _fixContext.correctionUtils,
7373 );
74- fixState = await _fixDiagnostic (fixContext, fixState, generator, error);
74+ fixState =
75+ await _fixDiagnostic (fixContext, fixState, generator, diagnostic);
7576
7677 // The original error was not fixable; continue to next generator.
7778 if (! (fixState.builder as ChangeBuilderImpl ).hasEdits) {
7879 continue ;
7980 }
8081
8182 // Compute fixes for the rest of the errors.
82- for (var diagnostic in diagnostics.where ((item) => item != error )) {
83+ for (var d in diagnostics.where ((item) => item != diagnostic )) {
8384 var fixContext = DartFixContext (
8485 instrumentationService: _fixContext.instrumentationService,
8586 workspace: _fixContext.workspace,
8687 libraryResult: _fixContext.libraryResult,
8788 unitResult: _fixContext.unitResult,
88- error: diagnostic ,
89+ error: d ,
8990 correctionUtils: _fixContext.correctionUtils,
9091 );
91- fixState =
92- await _fixDiagnostic (fixContext, fixState, generator, diagnostic);
92+ fixState = await _fixDiagnostic (fixContext, fixState, generator, d);
9393 }
9494 if (fixState is _NotEmptyFixState ) {
9595 var sourceChange = fixState.builder.sourceChange;
0 commit comments