Files
sdk/pkg/analyzer/tool/analysis_driver/inspect_exception.dart
T
Konstantin Shcheglov 364dd8936b Fix unnecessary_new in analyzer.
R=brianwilkerson@google.com

Change-Id: I70f80baa3da4b14c0a52c1f28da16a9ad26d7dda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127424
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2019-12-06 01:11:30 +00:00

49 lines
1.1 KiB
Dart

// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
import 'package:analyzer/src/summary/idl.dart';
import 'package:args/args.dart';
main(List<String> args) {
ArgParser argParser = ArgParser()..addFlag('raw');
ArgResults argResults = argParser.parse(args);
if (argResults.rest.length != 1) {
print(argParser.usage);
exitCode = 1;
return;
}
String path = argResults.rest[0];
List<int> bytes = File(path).readAsBytesSync();
AnalysisDriverExceptionContext context =
AnalysisDriverExceptionContext.fromBuffer(bytes);
print(context.path);
print('');
print('');
print('');
print(context.exception);
print('');
print('');
print('');
print(context.stackTrace);
print('');
print('');
print('');
context.files.forEach((file) {
print("=" * 40);
print('${file.path}');
print("-" * 40);
print('${file.content}');
print('');
print('');
print('');
});
}