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

Unified Diff: pkg/compiler/lib/src/diagnostics/messages.dart

Issue 1338783002: Show import chains for unsupported dart:* library imports. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Cleanup. Created 5 years, 3 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/compiler/lib/src/diagnostics/messages.dart
diff --git a/pkg/compiler/lib/src/diagnostics/messages.dart b/pkg/compiler/lib/src/diagnostics/messages.dart
index df778da9ea689b372c0737e238577ed5d53a6557..ccb1782b2c166dc4cd51eca3aafeeb30d41f0de7 100644
--- a/pkg/compiler/lib/src/diagnostics/messages.dart
+++ b/pkg/compiler/lib/src/diagnostics/messages.dart
@@ -166,6 +166,7 @@ enum MessageKind {
DEFERRED_TYPE_ANNOTATION,
DEPRECATED_TYPEDEF_MIXIN_SYNTAX,
DIRECTLY_THROWING_NSM,
+ DISALLOWED_LIBRARY_IMPORT,
DUPLICATE_DEFINITION,
DUPLICATE_EXPORT,
DUPLICATE_EXPORT_CONT,
@@ -273,6 +274,7 @@ enum MessageKind {
INVALID_USE_OF_SUPER,
LIBRARY_NAME_MISMATCH,
LIBRARY_NOT_FOUND,
+ LIBRARY_NOT_SUPPORTED,
LIBRARY_TAG_MUST_BE_FIRST,
MAIN_NOT_A_FUNCTION,
MAIN_WITH_EXTRA_PARAMETER,
@@ -2095,6 +2097,20 @@ main() => A.A = 1;
const MessageTemplate(MessageKind.LIBRARY_NOT_FOUND,
"Library not found '#{resolvedUri}'."),
+ MessageKind.LIBRARY_NOT_SUPPORTED:
+ const MessageTemplate(MessageKind.LIBRARY_NOT_SUPPORTED,
+ "Library not supported '#{resolvedUri}'.",
+ howToFix: "Try removing the dependency or enabling support using "
+ "the '--categories' option.",
+ examples: const [/*
+ """
+ import 'dart:io';
+ main() {}
+ """
+ */]),
+ // TODO(johnniwinther): Enable example when message_kind_test.dart
+ // supports library loader callbacks.
+
MessageKind.UNSUPPORTED_EQ_EQ_EQ:
const MessageTemplate(MessageKind.UNSUPPORTED_EQ_EQ_EQ,
"'===' is not an operator. "
@@ -3274,6 +3290,14 @@ $IMPORT_EXPERIMENTAL_MIRRORS_PADDING#{importChain}
****************************************************************
'''),
+ MessageKind.DISALLOWED_LIBRARY_IMPORT:
+ const MessageTemplate(MessageKind.DISALLOWED_LIBRARY_IMPORT, r'''
+Your app imports the unsupported library '#{uri}' via:''''''
+
+$DISALLOWED_LIBRARY_IMPORT_PADDING#{importChain}
sigurdm 2015/09/14 12:34:58 Consider reformatting
Johnni Winther 2015/09/14 13:23:39 Done.
+
+Use the --categories option to support import of '#{uri}'.
+'''),
MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND:
const MessageTemplate(
@@ -3315,6 +3339,7 @@ $IMPORT_EXPERIMENTAL_MIRRORS_PADDING#{importChain}
}; // End of TEMPLATES.
static const String IMPORT_EXPERIMENTAL_MIRRORS_PADDING = '\n* ';
+ static const String DISALLOWED_LIBRARY_IMPORT_PADDING = '\n ';
toString() => template;

Powered by Google App Engine
This is Rietveld 408576698