Version 2.11.0-194.0.dev
Merge commit 'f122752b9916e42577605b432d10aa70b8d3e379' into 'dev'
diff --git a/pkg/dartdev/lib/src/commands/fix.dart b/pkg/dartdev/lib/src/commands/fix.dart
index 945b709..7cd14e0 100644
--- a/pkg/dartdev/lib/src/commands/fix.dart
+++ b/pkg/dartdev/lib/src/commands/fix.dart
@@ -12,7 +12,6 @@
import '../core.dart';
import '../events.dart';
import '../sdk.dart';
-import '../utils.dart';
import 'analyze_impl.dart';
class FixCommand extends DartdevCommand<int> {
@@ -22,6 +21,13 @@
FixCommand() : super(cmdName, 'Fix Dart source code.', hidden: true);
@override
+ UsageEvent createUsageEvent(int exitCode) => FixUsageEvent(
+ usagePath,
+ exitCode: exitCode,
+ args: argResults.arguments,
+ );
+
+ @override
FutureOr<int> runImpl() async {
log.stdout('\n*** The `fix` command is provisional and subject to change '
'or removal in future releases. ***\n');
@@ -69,27 +75,28 @@
if (edits.isEmpty) {
log.stdout('Nothing to fix!');
} else {
- // todo (pq): consider a summary if more than `n` fixes are applied
- // (look at `dartfmt`)
- log.stdout('Applying fixes to:');
- for (var edit in edits) {
- var file = File(edit.file);
- log.stdout(' ${relativePath(file.path, dir)}');
- var code = file.existsSync() ? file.readAsStringSync() : '';
- code = SourceEdit.applySequence(code, edit.edits);
- file.writeAsStringSync(code);
+ progress = log.progress('Applying fixes');
+ var fileCount = await _applyFixes(edits);
+ progress.finish(showTiming: true);
+ if (fileCount > 0) {
+ log.stdout('Fixed $fileCount files.');
}
- log.stdout('Done.');
}
return 0;
}
- @override
- UsageEvent createUsageEvent(int exitCode) => FixUsageEvent(
- usagePath,
- exitCode: exitCode,
- args: argResults.arguments,
- );
+ Future<int> _applyFixes(List<SourceFileEdit> edits) async {
+ var files = <String>{};
+ for (var edit in edits) {
+ var fileName = edit.file;
+ files.add(fileName);
+ var file = File(fileName);
+ var code = await file.exists() ? await file.readAsString() : '';
+ code = SourceEdit.applySequence(code, edit.edits);
+ await file.writeAsString(code);
+ }
+ return files.length;
+ }
}
/// The [UsageEvent] for the fix command.
diff --git a/runtime/tests/vm/vm.status b/runtime/tests/vm/vm.status
index 7cab004..a80880d 100644
--- a/runtime/tests/vm/vm.status
+++ b/runtime/tests/vm/vm.status
@@ -115,6 +115,7 @@
dart/minimal_kernel_test: SkipSlow # gen_kernel is too slow in debug mode
dart/null_safety_autodetection_in_kernel_compiler_test: SkipSlow # gen_kernel is too slow in debug mode
dart/spawn_shutdown_test: Pass, Slow # VM Shutdown test, It can take some time for all the isolates to shutdown in a Debug build.
+dart/type_casts_with_null_safety_autodetection_test: Pass, Slow # Very slow in debug mode, uses --optimization-counter-threshold=10
dart_2/appjit_cha_deopt_test: Pass, Slow # Quite slow in debug mode, uses --optimization-counter-threshold=100
dart_2/b162922506_test: SkipSlow # Generates very large input file
dart_2/minimal_kernel_bytecode_test: SkipSlow # gen_kernel is too slow in debug mode
diff --git a/tests/lib/isolate/detect_nullsafety_helper.dart b/tests/lib/isolate/detect_nullsafety_helper.dart
index c8c263c..7f66ab8 100644
--- a/tests/lib/isolate/detect_nullsafety_helper.dart
+++ b/tests/lib/isolate/detect_nullsafety_helper.dart
@@ -28,6 +28,8 @@
args.add("--enable-experiment=non-nullable");
args.add(sourcePath);
var result = Process.runSync(exec, args);
+ print('snapshot $type stdout: ${result.stdout}');
+ print('snapshot $type stderr: ${result.stderr}');
}
void generateKernel(String sourcePath, String outPath) {
@@ -44,6 +46,8 @@
args.add("--enable-experiment=non-nullable");
args.add(filePath);
var result = Process.runSync(exec, args);
+ print('test stdout: ${result.stdout}');
+ print('test stderr: ${result.stderr}');
expect(result.stdout.contains('$expected'), true);
}
diff --git a/tests/lib/isolate/nnbd_spawn_autodetect_helper.dart b/tests/lib/isolate/nnbd_spawn_autodetect_helper.dart
index e689636..d0eaeac 100644
--- a/tests/lib/isolate/nnbd_spawn_autodetect_helper.dart
+++ b/tests/lib/isolate/nnbd_spawn_autodetect_helper.dart
@@ -54,6 +54,8 @@
args.add("--enable-experiment=non-nullable");
args.add(sourcePath);
var result = Process.runSync(exec, args);
+ print('snapshot $type stdout: ${result.stdout}');
+ print('snapshot $type stderr: ${result.stderr}');
}
void generateKernel(String sourcePath, String outPath) {
@@ -70,5 +72,7 @@
args.add("--enable-experiment=non-nullable");
args.add(filePath);
var result = Process.runSync(exec, args);
+ print('test stdout: ${result.stdout}');
+ print('test stderr: ${result.stderr}');
expect(result.stdout.contains('$expected'), true);
}
diff --git a/tools/VERSION b/tools/VERSION
index ac97587..39715f5 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
MAJOR 2
MINOR 11
PATCH 0
-PRERELEASE 193
+PRERELEASE 194
PRERELEASE_PATCH 0
\ No newline at end of file