diff --git a/lib/src/runner/parse_metadata.dart b/lib/src/runner/parse_metadata.dart index 7eaf83f37eb27e5aa6e91fbcb6c772bcfcceec5a..6edbcac4af478c3d0e9c66f9e642f99eff34fd22 100644 --- a/lib/src/runner/parse_metadata.dart +++ b/lib/src/runner/parse_metadata.dart @@ -548,7 +548,7 @@ class _Parser { // Load a SourceFile from scratch here since we're only ever going to emit // one error per file anyway. var contents = new File(_path).readAsStringSync(); - return new SourceFile(contents, url: p.toUri(_path)) + return new SourceFile.fromString (contents, url: p.toUri(_path)) .span(node.offset, node.end); } @@ -558,7 +558,7 @@ class _Parser { try { return fn(); } on SourceSpanFormatException catch (error) { - var file = new SourceFile(new File(_path).readAsStringSync(), + var file = new SourceFile.fromString(new File(_path).readAsStringSync(), url: p.toUri(_path)); var span = contextualizeSpan(error.span, literal, file); if (span == null) rethrow; diff --git a/pubspec.yaml b/pubspec.yaml index cd29ca42a00a4204c9ac9a67c3037f673de40df5..5f6dfc3a2f5f7aa32b1a084e3268848818dc66f7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: shelf_web_socket: '^0.2.0' source_map_stack_trace: '^1.1.4' source_maps: '^0.10.2' - source_span: '^1.0.0' + source_span: '^1.4.0' stack_trace: '^1.2.1' stream_channel: '^1.6.0' string_scanner: '>=0.1.1 <2.0.0'