File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 33// BSD-style license that can be found in the LICENSE file.
44
55import 'dart:async' ;
6+ import 'dart:convert' ;
67
78import 'package:analyzer/dart/element/element.dart' ;
89import 'package:build/build.dart' ;
@@ -106,14 +107,15 @@ class _Builder extends Builder {
106107 contentBuffer.writeln ('part of $name ;' );
107108 }
108109
109- for (var output in generatedOutputs) {
110+ for (var item in generatedOutputs) {
110111 contentBuffer
111112 ..writeln ()
112113 ..writeln (_headerLine)
113- ..writeln ('// Generator: ${output .generator }' )
114+ ..writeAll (
115+ LineSplitter .split (item.toString ()).map ((line) => '// $line \n ' ))
114116 ..writeln (_headerLine)
115117 ..writeln ()
116- ..write (output .output);
118+ ..write (item .output);
117119 }
118120
119121 var genPartContent = contentBuffer.toString ();
Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ class GeneratedOutput {
2121
2222 GeneratedOutput .fromError (this .generator, this .error, this .stackTrace)
2323 : this .output = _outputFromError (error);
24+
25+ @override
26+ String toString () => 'Generator: $generator ' ;
2427}
2528
2629String _outputFromError (Object error) {
You can’t perform that action at this time.
0 commit comments