| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart_style.src.formatter_exception; | 5 library dart_style.src.formatter_exception; |
| 6 | 6 |
| 7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
| 8 import 'package:source_span/source_span.dart'; | 8 import 'package:source_span/source_span.dart'; |
| 9 | 9 |
| 10 /// Thrown when one or more errors occurs while parsing the code to be | 10 /// Thrown when one or more errors occurs while parsing the code to be |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 var file = new SourceFile(error.source.contents.data, | 25 var file = new SourceFile(error.source.contents.data, |
| 26 url: error.source.fullName); | 26 url: error.source.fullName); |
| 27 | 27 |
| 28 var span = file.span(error.offset, error.offset + error.length); | 28 var span = file.span(error.offset, error.offset + error.length); |
| 29 if (buffer.isNotEmpty) buffer.writeln(); | 29 if (buffer.isNotEmpty) buffer.writeln(); |
| 30 buffer.write(span.message(error.message, color: true)); | 30 buffer.write(span.message(error.message, color: true)); |
| 31 } | 31 } |
| 32 | 32 |
| 33 return buffer.toString(); | 33 return buffer.toString(); |
| 34 } | 34 } |
| 35 |
| 36 String toString() => message(); |
| 35 } | 37 } |
| OLD | NEW |