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

Unified Diff: lib/src/options.dart

Issue 11450020: (Fix #215) better error printing in editor & extension, adds mapping for editor (Closed) Base URL: git@github.com:dart-lang/dart-web-components.git@master
Patch Set: Created 8 years 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: lib/src/options.dart
diff --git a/lib/src/options.dart b/lib/src/options.dart
index cf4664eb6ca0594607dc07c5c19469ba956c7d5d..9d2a9c3080323fd61dee57b3a1bda0abf065deda 100644
--- a/lib/src/options.dart
+++ b/lib/src/options.dart
@@ -31,6 +31,12 @@ class CompilerOptions {
/** Directory where all output will be generated. */
final String outputDir;
+ /**
+ * Whether to print error messages using the json format understood by the
+ * Dart editor.
+ */
+ final bool jsonFormat;
+
// We could make this faster, if it ever matters.
factory CompilerOptions() => parse(['']);
@@ -42,6 +48,7 @@ class CompilerOptions {
baseDir = args['basedir'],
outputDir = args['out'],
forceMangle = args['unique_output_filenames'],
+ jsonFormat = args['json_format'],
inputFile = args.rest.length > 0 ? args.rest[0] : null;
static CompilerOptions parse(List<String> arguments) {
@@ -60,6 +67,10 @@ class CompilerOptions {
'have the same name as your input files, even if they are in a '
'different directory',
defaultsTo: false, negatable: false)
+ ..addFlag('json_format',
+ help: 'Print error messsages in a json format easy to parse by tools,'
+ ' such as the Dart editor',
+ defaultsTo: false, negatable: false)
..addOption('out', abbr: 'o', help: 'Directory where to generate files'
' (defaults to the same directory as the source file)')
..addOption('basedir', help: 'Base directory where to find all source '
« lib/src/messages.dart ('K') | « lib/src/messages.dart ('k') | test/testing.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698