Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Unified Diff: pkg/front_end/lib/src/fasta/errors.dart

Issue 2691523002: Ensure locations are always provided, but don't store them yet. (Closed)
Patch Set: Missing file. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/errors.dart
diff --git a/pkg/front_end/lib/src/fasta/errors.dart b/pkg/front_end/lib/src/fasta/errors.dart
index 624d8f0fc5ffa66c2cf67e01366ab49f9b80dad6..9e4399dcd84f88a95f5f17dad15a3a416baf5322 100644
--- a/pkg/front_end/lib/src/fasta/errors.dart
+++ b/pkg/front_end/lib/src/fasta/errors.dart
@@ -20,6 +20,9 @@ import 'dart:io' show
import 'colors.dart' show
red;
+import 'util/relativize.dart' show
+ relativizeUri;
+
const String defaultServerAddress = "http://127.0.0.1:59410/";
/// Tracks if there has been a crash reported through [reportCrash]. Should be
@@ -56,13 +59,8 @@ class InputError {
// Windows.
String message = red("Error: ${safeToString(error)}");
if (uri != null) {
- String uri = "${this.uri}";
- String base = "${Uri.base}";
- if (uri.startsWith(base)) {
- uri = uri.substring(base.length);
- }
String position = charOffset == -1 ? "" : "$charOffset:";
- return "${uri}:$position $message";
+ return "${relativizeUri(uri)}:$position $message";
} else {
return message;
}

Powered by Google App Engine
This is Rietveld 408576698