Index: pkg/analyzer/lib/src/error.dart |
diff --git a/pkg/analyzer/lib/src/error.dart b/pkg/analyzer/lib/src/error.dart |
index 4c9b7af2045a4c860c8893927e194589f474ef85..483c433d50963ff2924652029842f11ddb1308ec 100644 |
--- a/pkg/analyzer/lib/src/error.dart |
+++ b/pkg/analyzer/lib/src/error.dart |
@@ -44,17 +44,16 @@ class AnalyzerError implements Exception { |
String toString() { |
var builder = new StringBuffer(); |
- var receiver = new _ContentReceiver(); |
- error.source.getContents(receiver); |
- var beforeError = receiver.result.substring(0, error.offset); |
+ var content = error.source.contents.data; |
+ var beforeError = content.substring(0, error.offset); |
var lineNumber = "\n".allMatches(beforeError).length + 1; |
builder.writeln("Error on line $lineNumber of ${error.source.fullName}: " |
"${error.message}"); |
var errorLineIndex = beforeError.lastIndexOf("\n") + 1; |
- var errorEndOfLineIndex = receiver.result.indexOf("\n", error.offset); |
- if (errorEndOfLineIndex == -1) errorEndOfLineIndex = receiver.result.length; |
- var errorLine = receiver.result.substring( |
+ var errorEndOfLineIndex = content.indexOf("\n", error.offset); |
+ if (errorEndOfLineIndex == -1) errorEndOfLineIndex = content.length; |
+ var errorLine = content.substring( |
errorLineIndex, errorEndOfLineIndex); |
var errorColumn = error.offset - errorLineIndex; |
var errorLength = error.length; |