Version 2.18.0-34.0.dev

Merge commit '20b560226e654f8885acd607b94f23b63bd9806b' into 'dev'
diff --git a/pkg/analysis_server/test/abstract_context.dart b/pkg/analysis_server/test/abstract_context.dart
index ab5be7e..92e318a 100644
--- a/pkg/analysis_server/test/abstract_context.dart
+++ b/pkg/analysis_server/test/abstract_context.dart
@@ -81,7 +81,7 @@
   String get workspaceRootPath => '/home';
 
   void addSource(String path, String content) {
-    newFile2(path, content);
+    newFile(path, content);
   }
 
   Future<void> analyzeTestPackageFiles() async {
@@ -134,7 +134,7 @@
       }
     }
 
-    newFile2(analysisOptionsPath, buffer.toString());
+    newFile(analysisOptionsPath, buffer.toString());
   }
 
   AnalysisDriver driverFor(String path) {
@@ -158,14 +158,14 @@
   }
 
   @override
-  File newFile2(String path, String content) {
+  File newFile(String path, String content) {
     if (_analysisContextCollection != null && !path.endsWith('.dart')) {
       throw StateError('Only dart files can be changed after analysis.');
     }
 
     path = convertPath(path);
     _addAnalyzedFileToDrivers(path);
-    return super.newFile2(path, content);
+    return super.newFile(path, content);
   }
 
   Future<ResolvedUnitResult> resolveFile(String path) async {
@@ -209,13 +209,13 @@
 
   /// Update `pubspec.yaml` and create the driver.
   void updateTestPubspecFile(String content) {
-    newFile2(testPubspecPath, content);
+    newFile(testPubspecPath, content);
   }
 
   void verifyCreatedCollection() {}
 
   void writePackageConfig(String path, PackageConfigFileBuilder config) {
-    newFile2(path, config.toContent(toUriStr: toUriStr));
+    newFile(path, config.toContent(toUriStr: toUriStr));
   }
 
   void writeTestPackageConfig({
diff --git a/pkg/analysis_server/test/abstract_single_unit.dart b/pkg/analysis_server/test/abstract_single_unit.dart
index 3dd0ad3..0177328 100644
--- a/pkg/analysis_server/test/abstract_single_unit.dart
+++ b/pkg/analysis_server/test/abstract_single_unit.dart
@@ -57,11 +57,11 @@
   }
 
   @override
-  File newFile2(String path, String content) {
+  File newFile(String path, String content) {
     if (useLineEndingsForPlatform) {
       content = normalizeNewlinesForPlatform(content);
     }
-    return super.newFile2(path, content);
+    return super.newFile(path, content);
   }
 
   Future<void> resolveFile2(String path) async {
diff --git a/pkg/analysis_server/test/analysis/get_errors_test.dart b/pkg/analysis_server/test/analysis/get_errors_test.dart
index e3f0c6e..ece1a97 100644
--- a/pkg/analysis_server/test/analysis/get_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/get_errors_test.dart
@@ -27,7 +27,7 @@
   }
 
   Future<void> test_afterAnalysisComplete() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 main() {
   print(42)
 }
@@ -40,12 +40,12 @@
   }
 
   Future<void> test_errorInPart() async {
-    var libraryFile = newFile2('$testPackageLibPath/a.dart', r'''
+    var libraryFile = newFile('$testPackageLibPath/a.dart', r'''
 part 'b.dart';
 class A {}
 ''');
 
-    var partFile = newFile2('$testPackageLibPath/b.dart', r'''
+    var partFile = newFile('$testPackageLibPath/b.dart', r'''
 part of 'a.dart';
 class A {}
 ''');
@@ -73,7 +73,7 @@
   }
 
   Future<void> test_hasErrors() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 main() {
   print(42)
 }
@@ -111,7 +111,7 @@
   }
 
   Future<void> test_noErrors() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 main() {
   print(42);
 }
diff --git a/pkg/analysis_server/test/analysis/get_hover_test.dart b/pkg/analysis_server/test/analysis/get_hover_test.dart
index bb65e9a..71b27ad 100644
--- a/pkg/analysis_server/test/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/analysis/get_hover_test.dart
@@ -20,11 +20,11 @@
 @reflectiveTest
 class AnalysisHoverBazelTest extends AbstractAnalysisTest {
   Future<void> test_bazel_notOwnedUri() async {
-    newFile2('/workspace/WORKSPACE', '');
+    newFile('/workspace/WORKSPACE', '');
     projectPath = newFolder('/workspace').path;
     testFile = convertPath('/workspace/dart/my/lib/test.dart');
 
-    newFile2(
+    newFile(
       '/workspace/bazel-genfiles/dart/my/lib/test.dart',
       '// generated',
     );
@@ -68,7 +68,7 @@
   }
 
   Future<void> test_class_constructor_named() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 class A {
   /// my doc
@@ -99,7 +99,7 @@
   }
 
   Future<void> test_class_constructor_noKeyword_const() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 class A {
   const A(int i);
@@ -126,7 +126,7 @@
   }
 
   Future<void> test_class_constructor_noKeyword_new() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 class A {}
 void f() {
@@ -151,7 +151,7 @@
   }
 
   Future<void> test_class_constructor_synthetic() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 class A {
 }
@@ -177,7 +177,7 @@
   }
 
   Future<void> test_class_constructor_synthetic_withTypeArgument() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 class A<T> {}
 void f() {
@@ -219,7 +219,7 @@
   }
 
   Future<void> test_class_constructorReference_named() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A<T> {
   /// doc aaa
   /// doc bbb
@@ -246,7 +246,7 @@
   }
 
   Future<void> test_class_constructorReference_unnamed_declared() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A<T> {
   /// doc aaa
   /// doc bbb
@@ -273,7 +273,7 @@
   }
 
   Future<void> test_class_constructorReference_unnamed_declared_new() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A<T> {
   /// doc aaa
   /// doc bbb
@@ -300,7 +300,7 @@
   }
 
   Future<void> test_class_constructorReference_unnamed_synthetic() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A<T> {}
 
 void f() {
@@ -323,7 +323,7 @@
   }
 
   Future<void> test_class_declaration() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A<E> {}
 class I1<K, V> {}
 class I2<E> {}
@@ -342,7 +342,7 @@
   }
 
   Future<void> test_class_declaration_abstract() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {}
 abstract class B extends A {}
 ''');
@@ -354,7 +354,7 @@
   }
 
   Future<void> test_class_getter_synthetic() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 class A {
   /// doc aaa
@@ -379,7 +379,7 @@
   }
 
   Future<void> test_class_method_declaration() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 class A {
   /// doc aaa
@@ -404,7 +404,7 @@
   }
 
   Future<void> test_class_method_reference() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 class A {
   List<String> mmm(int a, String b) {
@@ -432,7 +432,7 @@
   }
 
   Future<void> test_class_method_reference_deprecated() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   @deprecated
   static void test() {}
@@ -450,7 +450,7 @@
   }
 
   Future<void> test_class_method_reference_genericMethod() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 
 abstract class Stream<T> {
@@ -482,7 +482,7 @@
   }
 
   Future<void> test_class_setter_hasDocumentation() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// getting
   int get foo => 42;
@@ -501,7 +501,7 @@
   }
 
   Future<void> test_class_setter_noDocumentation() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// getting
   int get foo => 42;
@@ -519,7 +519,7 @@
   }
 
   Future<void> test_class_setter_super_hasDocumentation() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// pgetting
   int get foo => 42;
@@ -543,7 +543,7 @@
   }
 
   Future<void> test_class_setter_super_noDocumentation() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// pgetting
   int get foo => 42;
@@ -566,7 +566,7 @@
 
   @failingTest
   Future<void> test_class_setter_super_noSetter() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// pgetting
   int get foo => 42;
@@ -586,7 +586,7 @@
   }
 
   Future<void> test_dartdoc_block() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /**
  * doc aaa
  * doc bbb
@@ -599,7 +599,7 @@
   }
 
   Future<void> test_dartdoc_inherited_fromInterface() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// my doc
   m() {} // in A
@@ -614,7 +614,7 @@
   }
 
   Future<void> test_dartdoc_inherited_fromSuper_direct() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// my doc
   m() {} // in A
@@ -629,7 +629,7 @@
   }
 
   Future<void> test_dartdoc_inherited_fromSuper_indirect() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// my doc
   m() {}
@@ -645,7 +645,7 @@
   }
 
   Future<void> test_dartdoc_inherited_preferSuper() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// my doc
   m() {}
@@ -664,7 +664,7 @@
   }
 
   Future<void> test_dartdoc_line() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// doc aaa
 /// doc bbb
 void f() {
@@ -675,7 +675,7 @@
   }
 
   Future<void> test_enum_declaration() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 enum MyEnum {AAA, BBB, CCC}
 ''');
     var hover = await prepareHover('MyEnum');
@@ -686,7 +686,7 @@
   }
 
   Future<void> test_enum_getter() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 enum E {
   v;
@@ -709,7 +709,7 @@
   }
 
   Future<void> test_enum_getter_synthetic() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 enum E {
   v;
@@ -735,7 +735,7 @@
   }
 
   Future<void> test_enum_method_declaration() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 enum E {
   v;
@@ -761,7 +761,7 @@
   }
 
   Future<void> test_enum_method_reference() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 enum E {
   v;
@@ -791,7 +791,7 @@
   }
 
   Future<void> test_enum_setter_hasDocumentation() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 enum E {
   v;
   /// getting
@@ -811,7 +811,7 @@
   }
 
   Future<void> test_extensionDeclaration() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {}
 /// Comment
 extension E on A {}
@@ -827,7 +827,7 @@
   Future<void> test_function_multilineElementDescription() async {
     // Functions with at least 3 params will have element descriptions formatted
     // across multiple lines.
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 List<String> fff(int a, [String b = 'b', String c = 'c']) {
 }
 ''');
@@ -841,7 +841,7 @@
   }
 
   Future<void> test_function_topLevel_declaration() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 /// doc aaa
 /// doc bbb
@@ -865,7 +865,7 @@
   }
 
   Future<void> test_functionReference_classMethod_instance() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A<T> {
   /// doc aaa
   /// doc bbb
@@ -892,7 +892,7 @@
   }
 
   Future<void> test_functionReference_classMethod_static() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A<T> {
   /// doc aaa
   /// doc bbb
@@ -919,7 +919,7 @@
   }
 
   Future<void> test_functionReference_topLevelFunction() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// doc aaa
 /// doc bbb
 int foo<T>(T a) => 0;
@@ -944,7 +944,7 @@
   }
 
   Future<void> test_integerLiteral() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 void f() {
   foo(123);
 }
@@ -969,7 +969,7 @@
   }
 
   Future<void> test_integerLiteral_promoted() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 void f() {
   foo(123);
 }
@@ -1016,7 +1016,7 @@
   }
 
   Future<void> test_localVariable_declaration() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 class A {
   m() {
@@ -1040,7 +1040,7 @@
   }
 
   Future<void> test_localVariable_reference_withPropagatedType() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 void f() {
   var vvv = 123;
@@ -1061,7 +1061,7 @@
   }
 
   Future<void> test_mixin_declaration() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 mixin A on B, C implements D, E {}
 class B {}
 class C {}
@@ -1076,7 +1076,7 @@
 
   @failingTest
   Future<void> test_mixin_reference() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 mixin A {}
 abstract class B {}
 class C with A implements B {}
@@ -1088,7 +1088,7 @@
   }
 
   Future<void> test_noHoverInfo() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 void f() {
   // nothing
@@ -1099,7 +1099,7 @@
   }
 
   Future<void> test_nonNullable() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 int? f(double? a) => null;
 
 void f() {
@@ -1112,7 +1112,7 @@
   }
 
   Future<void> test_parameter_declaration_fieldFormal() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// The field documentation.
   final int fff;
@@ -1133,7 +1133,7 @@
   }
 
   Future<void> test_parameter_declaration_required() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 library my.library;
 class A {
   /// The method documentation.
@@ -1157,7 +1157,7 @@
   }
 
   Future<void> test_parameter_defaultValue() async {
-    newFile2(testFilePath, 'void b([int a=123]) { }');
+    newFile(testFilePath, 'void b([int a=123]) { }');
     var hover = await prepareHover('a=');
     // element
     expect(hover.elementDescription, '[int a = 123]');
@@ -1166,7 +1166,7 @@
 
   Future<void>
       test_parameter_ofConstructor_optionalPositional_super_defaultValue_explicit() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   A([int a = 1]);
 }
@@ -1182,7 +1182,7 @@
 
   Future<void>
       test_parameter_ofConstructor_optionalPositional_super_defaultValue_inherited() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   A([int a = 1]);
 }
@@ -1198,7 +1198,7 @@
 
   Future<void>
       test_parameter_ofConstructor_optionalPositional_super_defaultValue_inherited2() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   A([num a = 1.2]);
 }
@@ -1213,7 +1213,7 @@
   }
 
   Future<void> test_parameter_reference_fieldFormal() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 class A {
   /// The field documentation.
   final int fff;
@@ -1234,7 +1234,7 @@
   }
 
   Future<void> test_simpleIdentifier_typedef_functionType() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 typedef A = void Function(int);
 ''');
     var hover = await prepareHover('A');
@@ -1246,7 +1246,7 @@
   }
 
   Future<void> test_simpleIdentifier_typedef_interfaceType() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 typedef A = Map<int, String>;
 ''');
     var hover = await prepareHover('A');
@@ -1258,7 +1258,7 @@
   }
 
   Future<void> test_simpleIdentifier_typedef_legacy() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 typedef void A(int a);
 ''');
     var hover = await prepareHover('A');
diff --git a/pkg/analysis_server/test/analysis/get_navigation_test.dart b/pkg/analysis_server/test/analysis/get_navigation_test.dart
index 9927cea..15c022d 100644
--- a/pkg/analysis_server/test/analysis/get_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/get_navigation_test.dart
@@ -62,7 +62,7 @@
 
   Future<void> test_comment_toolSeeCodeComment() async {
     var examplePath = 'examples/api/foo.dart';
-    newFile2('$testPackageLibPath/$examplePath', '');
+    newFile('$testPackageLibPath/$examplePath', '');
     addTestFile('''
 /// {@tool dartpad}
 /// ** See code in $examplePath **
@@ -147,7 +147,7 @@
   /// TODO(scheglov) Rewrite these tests to work with any file.
   @FailingTest(reason: 'requires infrastructure rewriting')
   Future<void> test_fileOutsideOfRoot() async {
-    var file = newFile2('/outside.dart', '''
+    var file = newFile('/outside.dart', '''
 main() {
   var test = 0;
   print(test);
@@ -187,8 +187,8 @@
   }
 
   Future<void> test_importUri_configurations() async {
-    final ioFile = newFile2('$testPackageLibPath/io.dart', '');
-    final htmlFile = newFile2('$testPackageLibPath/html.dart', '');
+    final ioFile = newFile('$testPackageLibPath/io.dart', '');
+    final htmlFile = newFile('$testPackageLibPath/html.dart', '');
     addTestFile('''
 import 'foo.dart'
   if (dart.library.io) 'io.dart'
diff --git a/pkg/analysis_server/test/analysis/get_signature_test.dart b/pkg/analysis_server/test/analysis/get_signature_test.dart
index 3d14e5d..5edf1ad 100644
--- a/pkg/analysis_server/test/analysis/get_signature_test.dart
+++ b/pkg/analysis_server/test/analysis/get_signature_test.dart
@@ -45,7 +45,7 @@
   }
 
   Future<void> test_constructor() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// MyClass doc
 class MyClass {
   /// MyClass constructor doc
@@ -68,7 +68,7 @@
   }
 
   Future<void> test_constructor_factory() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// MyClass doc
 class MyClass {
   /// MyClass private constructor doc
@@ -95,7 +95,7 @@
   }
 
   Future<void> test_constructor_named() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// MyClass doc
 class MyClass {
   /// MyClass.foo constructor doc
@@ -118,7 +118,7 @@
   }
 
   Future<void> test_does_not_walk_up_over_closure() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 one(String name, int length) {}
 main() {
   one("Danny", () {
@@ -142,7 +142,7 @@
   }
 
   Future<void> test_error_function_unknown() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 someFunc(/*^*/);
 ''');
     var response = await prepareRawSignature('/*^*/');
@@ -154,7 +154,7 @@
   }
 
   Future<void> test_error_offset_invalid() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 a() {}
 ''');
     var response = await prepareRawSignatureAt(1000);
@@ -166,7 +166,7 @@
   }
 
   Future<void> test_function_expression() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// f doc
 int Function(String) f(String s) => (int i) => int.parse(s) + i;
 main() {
@@ -184,14 +184,14 @@
   }
 
   Future<void> test_function_from_other_file() async {
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 /// one doc
 one(String name, int length) {}
 main() {
   one("Danny", /*^*/);
 }
 ''');
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 import 'other.dart';
 main() {
   one("Danny", /*^*/);
@@ -212,7 +212,7 @@
   }
 
   Future<void> test_function_irrelevant_parens() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// one doc
 one(String name, int length) {}
 main() {
@@ -234,7 +234,7 @@
   }
 
   Future<void> test_function_named() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// one doc
 one(String name, {int length}) {}
 main() {
@@ -254,7 +254,7 @@
   }
 
   Future<void> test_function_named_with_default_int() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// one doc
 one(String name, {int length = 1}) {}
 main() {
@@ -276,7 +276,7 @@
   }
 
   Future<void> test_function_named_with_default_string() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// one doc
 one(String name, {String email = "a@b.c"}) {}
 main() {
@@ -299,7 +299,7 @@
 
   Future<void> test_function_nested_call_inner() async {
     // eg. foo(bar(1, 2));
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// one doc
 one(String one) {}
 /// two doc
@@ -320,7 +320,7 @@
 
   Future<void> test_function_nested_call_outer() async {
     // eg. foo(bar(1, 2));
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// one doc
 one(String one) {}
 /// two doc
@@ -340,7 +340,7 @@
   }
 
   Future<void> test_function_no_dart_doc() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 one(String name, int length) {}
 main() {
   one("Danny", /*^*/);
@@ -361,7 +361,7 @@
   }
 
   Future<void> test_function_optional() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// one doc
 one(String name, [int length]) {}
 main() {
@@ -383,7 +383,7 @@
   }
 
   Future<void> test_function_optional_with_default() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// one doc
 one(String name, [int length = 11]) {}
 main() {
@@ -405,7 +405,7 @@
   }
 
   Future<void> test_function_required() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// one doc
 one(String name, int length) {}
 main() {
@@ -427,7 +427,7 @@
   }
 
   Future<void> test_function_zero_arguments() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// one doc
 one() {}
 main() {
@@ -463,7 +463,7 @@
   }
 
   Future<void> test_method_instance() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// MyClass doc
 class MyClass {
   /// MyClass constructor doc
@@ -489,7 +489,7 @@
   }
 
   Future<void> test_method_static() async {
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 /// MyClass doc
 class MyClass {
   /// MyClass constructor doc
diff --git a/pkg/analysis_server/test/analysis/notification_analyzed_files_test.dart b/pkg/analysis_server/test/analysis/notification_analyzed_files_test.dart
index 31ae228..4b776f66 100644
--- a/pkg/analysis_server/test/analysis/notification_analyzed_files_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_analyzed_files_test.dart
@@ -73,7 +73,7 @@
   }
 
   Future<void> test_beforeAnalysis_excludeYamlFiles() async {
-    var yamlFile = newFile2('$testPackageRootPath/sample.yaml', '');
+    var yamlFile = newFile('$testPackageRootPath/sample.yaml', '');
     addTestFile('''
 class A {}
 ''');
@@ -114,7 +114,7 @@
     // Making a change that *does* affect the set of reachable files should
     // trigger the notification to be re-sent.
     addTestFile('class A {}');
-    var foo = newFile2('/foo.dart', 'library foo;');
+    var foo = newFile('/foo.dart', 'library foo;');
     await prepareAnalyzedFiles();
     expect(analyzedFilesReceived, isTrue);
 
diff --git a/pkg/analysis_server/test/analysis/notification_errors_test.dart b/pkg/analysis_server/test/analysis/notification_errors_test.dart
index ba24eaa..ba6c408 100644
--- a/pkg/analysis_server/test/analysis/notification_errors_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_errors_test.dart
@@ -105,7 +105,7 @@
   Future<void> test_androidManifestFile() async {
     var manifestPath =
         join(testPackageRootPath, 'android', 'AndroidManifest.xml');
-    var manifestFile = newFile2(manifestPath, '''
+    var manifestFile = newFile(manifestPath, '''
 <manifest
     xmlns:android="http://schemas.android.com/apk/res/android">
     <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
@@ -135,7 +135,7 @@
   Future<void> test_androidManifestFile_dotDirectoryIgnored() async {
     var manifestPath =
         join(testPackageRootPath, 'ios', '.symlinks', 'AndroidManifest.xml');
-    var manifestFile = newFile2(manifestPath, '''
+    var manifestFile = newFile(manifestPath, '''
 <manifest
     xmlns:android="http://schemas.android.com/apk/res/android">
     <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
@@ -170,10 +170,10 @@
     // Add the generated project into package_config.json.
     final config = PackageConfigFileBuilder();
     config.add(name: 'foo', rootPath: generatedProject);
-    newFile2(configPath, config.toContent(toUriStr: toUriStr));
+    newFile(configPath, config.toContent(toUriStr: toUriStr));
 
     // Set up project that references the class prior to initial analysis.
-    newFile2(generatedFile, 'class A {}');
+    newFile(generatedFile, 'class A {}');
     addTestFile('''
 import 'package:foo/foo.dart';
 A? a;
@@ -194,7 +194,7 @@
   }
 
   Future<void> test_dataFile() async {
-    var dataFile = newFile2('$testPackageLibPath/fix_data.yaml', '''
+    var dataFile = newFile('$testPackageLibPath/fix_data.yaml', '''
 version: 1
 transforms:
 ''');
@@ -220,7 +220,7 @@
     await setRoots(included: [workspaceRootPath], excluded: []);
     addTestFile('');
     var brokenFile =
-        newFile2(join(testPackageRootPath, '.dart_tool/broken.dart'), 'err');
+        newFile(join(testPackageRootPath, '.dart_tool/broken.dart'), 'err');
 
     await waitForTasksFinished();
     await pumpEventQueue(times: 5000);
@@ -244,7 +244,7 @@
     await setRoots(included: [workspaceRootPath], excluded: []);
     addTestFile('');
     var brokenFile =
-        newFile2('$testPackageRootPath/.dart_tool/broken.dart', 'err');
+        newFile('$testPackageRootPath/.dart_tool/broken.dart', 'err');
 
     await waitForTasksFinished();
     await pumpEventQueue(times: 5000);
@@ -269,7 +269,7 @@
 ''');
     await setRoots(included: [workspaceRootPath], excluded: []);
     var excludedFile =
-        newFile2('$testPackageRootPath/excluded/broken.dart', 'err');
+        newFile('$testPackageRootPath/excluded/broken.dart', 'err');
 
     // There should be no errors initially.
     await waitForTasksFinished();
@@ -344,7 +344,7 @@
 
   Future<void> test_notInAnalysisRoot() async {
     await setRoots(included: [workspaceRootPath], excluded: []);
-    var otherFile = newFile2('/other.dart', 'UnknownType V;');
+    var otherFile = newFile('/other.dart', 'UnknownType V;');
     addTestFile('''
 import '/other.dart';
 main() {
@@ -361,7 +361,7 @@
     await setRoots(included: [workspaceRootPath], excluded: []);
     addTestFile('');
     var brokenFile =
-        newFile2('$testPackageRootPath/.dart_tool/broken.dart', 'err');
+        newFile('$testPackageRootPath/.dart_tool/broken.dart', 'err');
 
     await waitForTasksFinished();
     await pumpEventQueue(times: 5000);
diff --git a/pkg/analysis_server/test/analysis/notification_highlights2_test.dart b/pkg/analysis_server/test/analysis/notification_highlights2_test.dart
index 2e70411..e2364c2 100644
--- a/pkg/analysis_server/test/analysis/notification_highlights2_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_highlights2_test.dart
@@ -328,7 +328,7 @@
 void f() {
   var part = 42;
 }''');
-    newFile2('/project/bin/my_part.dart', 'part of lib;');
+    newFile('/project/bin/my_part.dart', 'part of lib;');
     await prepareHighlights();
     assertHasRegion(HighlightRegionType.BUILT_IN, 'part "my_');
     assertNoRegion(HighlightRegionType.BUILT_IN, 'part = 42');
@@ -1690,7 +1690,7 @@
   }
 
   void _addLibraryForTestPart() {
-    newFile2('$testPackageLibPath/my_lib.dart', '''
+    newFile('$testPackageLibPath/my_lib.dart', '''
 library lib;
 part 'test.dart';
     ''');
diff --git a/pkg/analysis_server/test/analysis/notification_implemented_test.dart b/pkg/analysis_server/test/analysis/notification_implemented_test.dart
index 1b978de..29c6248 100644
--- a/pkg/analysis_server/test/analysis/notification_implemented_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_implemented_test.dart
@@ -346,7 +346,7 @@
   }
 
   Future<void> test_method_withMethod_private_differentLib() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 import 'test.dart';
 class B extends A {
   void _m() {}
diff --git a/pkg/analysis_server/test/analysis/notification_navigation_test.dart b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
index 399eb4a..30aa898 100644
--- a/pkg/analysis_server/test/analysis/notification_navigation_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_navigation_test.dart
@@ -280,7 +280,7 @@
   }
 
   Future<void> test_annotationConstructor_importPrefix() async {
-    newFile2('$testPackageLibPath/my_annotation.dart', r'''
+    newFile('$testPackageLibPath/my_annotation.dart', r'''
 library an;
 class MyAnnotation {
   const MyAnnotation();
@@ -355,7 +355,7 @@
   }
 
   Future<void> test_annotationField_importPrefix() async {
-    newFile2('$testPackageLibPath/mayn.dart', r'''
+    newFile('$testPackageLibPath/mayn.dart', r'''
 library an;
 const myan = new Object();
 ''');
@@ -827,7 +827,7 @@
   }
 
   Future<void> test_functionReference_importPrefix_function() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void foo<T>() {}
 ''');
     addTestFile('''
@@ -1076,8 +1076,8 @@
   }
 
   Future<void> test_multiplyDefinedElement() async {
-    newFile2('$testPackageLibPath/libA.dart', 'library A; int TEST = 1;');
-    newFile2('$testPackageLibPath/libB.dart', 'library B; int TEST = 2;');
+    newFile('$testPackageLibPath/libA.dart', 'library A; int TEST = 1;');
+    newFile('$testPackageLibPath/libB.dart', 'library B; int TEST = 2;');
     addTestFile('''
 import 'libA.dart';
 import 'libB.dart';
@@ -1168,7 +1168,7 @@
 
   Future<void> test_partOf() async {
     var libCode = 'library lib; part "test.dart";';
-    var libFile = newFile2('$testPackageLibPath/lib.dart', libCode).path;
+    var libFile = newFile('$testPackageLibPath/lib.dart', libCode).path;
     addTestFile('part of lib;');
     await prepareNavigation();
     assertHasRegionString('lib');
@@ -1227,9 +1227,9 @@
   }
 
   Future<void> test_string_configuration() async {
-    newFile2('$testPackageLibPath/lib.dart', '').path;
-    var lib2File = newFile2('$testPackageLibPath/lib2.dart', '').path;
-    newFile2(
+    newFile('$testPackageLibPath/lib.dart', '').path;
+    var lib2File = newFile('$testPackageLibPath/lib2.dart', '').path;
+    newFile(
         testFilePath, 'import "lib.dart" if (dart.library.html) "lib2.dart";');
     await prepareNavigation();
     assertHasRegionString('"lib2.dart"');
@@ -1238,7 +1238,7 @@
 
   Future<void> test_string_export() async {
     var libCode = 'library lib;';
-    var libFile = newFile2('$testPackageLibPath/lib.dart', libCode).path;
+    var libFile = newFile('$testPackageLibPath/lib.dart', libCode).path;
     addTestFile('export "lib.dart";');
     await prepareNavigation();
     assertHasRegionString('"lib.dart"');
@@ -1253,7 +1253,7 @@
 
   Future<void> test_string_import() async {
     var libCode = 'library lib;';
-    var libFile = newFile2('$testPackageLibPath/lib.dart', libCode).path;
+    var libFile = newFile('$testPackageLibPath/lib.dart', libCode).path;
     addTestFile('import "lib.dart";');
     await prepareNavigation();
     assertHasRegionString('"lib.dart"');
@@ -1274,8 +1274,7 @@
 
   Future<void> test_string_part() async {
     var unitCode = 'part of lib;  f() {}';
-    var unitFile =
-        newFile2('$testPackageLibPath/test_unit.dart', unitCode).path;
+    var unitFile = newFile('$testPackageLibPath/test_unit.dart', unitCode).path;
     addTestFile('''
 library lib;
 part "test_unit.dart";
diff --git a/pkg/analysis_server/test/analysis/notification_overrides_test.dart b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
index ac0e7c8..015d6d3 100644
--- a/pkg/analysis_server/test/analysis/notification_overrides_test.dart
+++ b/pkg/analysis_server/test/analysis/notification_overrides_test.dart
@@ -222,7 +222,7 @@
   }
 
   Future<void> test_class_BAD_privateByPrivate_inDifferentLib() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 class A {
   void _m() {}
 }
diff --git a/pkg/analysis_server/test/analysis/reanalyze_test.dart b/pkg/analysis_server/test/analysis/reanalyze_test.dart
index d460e3e..b88016a 100644
--- a/pkg/analysis_server/test/analysis/reanalyze_test.dart
+++ b/pkg/analysis_server/test/analysis/reanalyze_test.dart
@@ -33,7 +33,7 @@
   Future<void> test_reanalyze() async {
     var b = getFolder(testPackageLibPath).parent.getChildAssumingFile('b.dart');
 
-    var file = newFile2('$testPackageTestPath/a.dart', r'''
+    var file = newFile('$testPackageTestPath/a.dart', r'''
 import '../b.dart';
 
 var b = B();
diff --git a/pkg/analysis_server/test/analysis/set_priority_files_test.dart b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
index 47b2f68..5b90cef 100644
--- a/pkg/analysis_server/test/analysis/set_priority_files_test.dart
+++ b/pkg/analysis_server/test/analysis/set_priority_files_test.dart
@@ -41,7 +41,7 @@
   }
 
   Future<void> test_fileInAnalysisRootAddedLater() async {
-    var file = newFile2('/other/file.dart', '');
+    var file = newFile('/other/file.dart', '');
     await _setPriorityFile(file);
     await setRoots(included: [file.parent.path], excluded: []);
     _verifyPriorityFiles(file);
@@ -61,7 +61,7 @@
   }
 
   Future<void> test_fileNotInAnalysisRoot() async {
-    var file = newFile2('/other/file.dart', '');
+    var file = newFile('/other/file.dart', '');
     await _setPriorityFile(file);
     _verifyPriorityFiles(file);
   }
@@ -72,7 +72,7 @@
   exclude:
     - 'samples/**'
 ''');
-    var file = newFile2('$testPackageRootPath/samples/sample.dart', '');
+    var file = newFile('$testPackageRootPath/samples/sample.dart', '');
     // attempt to set priority file
     await _setPriorityFile(file);
     _verifyPriorityFiles(file);
@@ -81,7 +81,7 @@
   Future<void> test_ignoredInAnalysisOptions_inChildContext() async {
     newPackageConfigJsonFile(testPackageRootPath, '');
     newPackageConfigJsonFile('$testPackageRootPath/child', '');
-    var sampleFile = newFile2(
+    var sampleFile = newFile(
       '$testPackageRootPath/child/samples/sample.dart',
       '',
     );
@@ -98,7 +98,7 @@
   Future<void> test_ignoredInAnalysisOptions_inRootContext() async {
     newPackageConfigJsonFile(testPackageRootPath, '');
     newPackageConfigJsonFile('$testPackageRootPath/child', '');
-    var sampleFile = newFile2(
+    var sampleFile = newFile(
       '$testPackageRootPath/child/samples/sample.dart',
       '',
     );
diff --git a/pkg/analysis_server/test/analysis/update_content_test.dart b/pkg/analysis_server/test/analysis/update_content_test.dart
index 853eebb..ac230a7 100644
--- a/pkg/analysis_server/test/analysis/update_content_test.dart
+++ b/pkg/analysis_server/test/analysis/update_content_test.dart
@@ -92,18 +92,18 @@
         ..add(name: 'aaa', rootPath: '$workspaceRootPath/aaa'),
     );
 
-    var aaa = newFile2('$workspaceRootPath/aaa/lib/aaa.dart', r'''
+    var aaa = newFile('$workspaceRootPath/aaa/lib/aaa.dart', r'''
 void f(int _) {}
 ''');
 
-    var foo = newFile2('$workspaceRootPath/foo/lib/foo.dart', r'''
+    var foo = newFile('$workspaceRootPath/foo/lib/foo.dart', r'''
 import 'package:aaa/aaa.dart';
 void main() {
   f();
 }
 ''');
 
-    var bar = newFile2('$workspaceRootPath/bar/lib/bar.dart', r'''
+    var bar = newFile('$workspaceRootPath/bar/lib/bar.dart', r'''
 import 'package:aaa/aaa.dart';
 void main() {
   f();
@@ -168,7 +168,7 @@
   }
 
   Future<void> test_overlayOnly() async {
-    var a = newFile2('$testPackageLibPath/a.dart', '');
+    var a = newFile('$testPackageLibPath/a.dart', '');
     var b = getFile('$testPackageLibPath/b.dart');
 
     await setRoots(included: [workspaceRootPath], excluded: []);
diff --git a/pkg/analysis_server/test/analysis_abstract.dart b/pkg/analysis_server/test/analysis_abstract.dart
index 8a06015..8d2f844 100644
--- a/pkg/analysis_server/test/analysis_abstract.dart
+++ b/pkg/analysis_server/test/analysis_abstract.dart
@@ -86,7 +86,7 @@
   }
 
   String addTestFile(String content) {
-    newFile2(testFile, content);
+    newFile(testFile, content);
     testCode = content;
     return testFile;
   }
diff --git a/pkg/analysis_server/test/analysis_server_base.dart b/pkg/analysis_server/test/analysis_server_base.dart
index 69ddef5..7ea163f 100644
--- a/pkg/analysis_server/test/analysis_server_base.dart
+++ b/pkg/analysis_server/test/analysis_server_base.dart
@@ -140,7 +140,7 @@
 
   /// TODO(scheglov) rename
   void addTestFile(String content) {
-    newFile2(testFilePath, content);
+    newFile(testFilePath, content);
   }
 
   void assertResponseFailure(
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart
index 31c0a79..9cc9022 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -46,8 +46,8 @@
     server.serverServices = {ServerService.STATUS};
     newFolder('/foo');
     newFolder('/bar');
-    newFile2('/foo/foo.dart', 'import "../bar/bar.dart";');
-    var bar = newFile2('/bar/bar.dart', 'library bar;');
+    newFile('/foo/foo.dart', 'import "../bar/bar.dart";');
+    var bar = newFile('/bar/bar.dart', 'library bar;');
     await server.setAnalysisRoots('0', ['/foo', '/bar'], []);
     var subscriptions = <AnalysisService, Set<String>>{};
     for (var service in AnalysisService.VALUES) {
@@ -119,7 +119,7 @@
     // Create a file that references two packages, which will we write to
     // package_config.json individually.
     newFolder(projectRoot);
-    newFile2(
+    newFile(
       projectTestFile,
       r'''
       import "package:foo/foo.dart";'
@@ -183,7 +183,7 @@
   Future test_serverStatusNotifications_hasFile() async {
     server.serverServices.add(ServerService.STATUS);
 
-    newFile2('/test/lib/a.dart', r'''
+    newFile('/test/lib/a.dart', r'''
 class A {}
 ''');
     await server.setAnalysisRoots('0', [convertPath('/test')], []);
@@ -245,7 +245,7 @@
   Future<void>
       test_setAnalysisSubscriptions_fileInIgnoredFolder_newOptions() async {
     var path = convertPath('/project/samples/sample.dart');
-    newFile2(path, '');
+    newFile(path, '');
     newAnalysisOptionsYamlFile2('/project', r'''
 analyzer:
   exclude:
@@ -266,7 +266,7 @@
   Future<void>
       test_setAnalysisSubscriptions_fileInIgnoredFolder_oldOptions() async {
     var path = convertPath('/project/samples/sample.dart');
-    newFile2(path, '');
+    newFile(path, '');
     newAnalysisOptionsYamlFile2('/project', r'''
 analyzer:
   exclude:
@@ -334,7 +334,7 @@
   }
 
   void writePackageConfig(String path, PackageConfigFileBuilder config) {
-    newFile2(path, config.toContent(toUriStr: toUriStr));
+    newFile(path, config.toContent(toUriStr: toUriStr));
   }
 
   /// Creates a simple package named [name] with [content] in the file at
@@ -343,7 +343,7 @@
   /// Returns a [Folder] that represents the packages `lib` folder.
   Folder _addSimplePackage(String name, String content) {
     final packagePath = '/packages/$name';
-    final file = newFile2('$packagePath/lib/$name.dart', content);
+    final file = newFile('$packagePath/lib/$name.dart', content);
     return file.parent;
   }
 }
diff --git a/pkg/analysis_server/test/client/completion_driver_test.dart b/pkg/analysis_server/test/client/completion_driver_test.dart
index c8ee38b..1d0f6c4 100644
--- a/pkg/analysis_server/test/client/completion_driver_test.dart
+++ b/pkg/analysis_server/test/client/completion_driver_test.dart
@@ -297,11 +297,11 @@
 
 mixin CompletionWithSuggestionsTestCases on AbstractCompletionDriverTest {
   Future<void> test_project_filterImports_defaultConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 export 'a.dart';
 ''');
 
@@ -325,13 +325,13 @@
 
   /// See: https://github.com/dart-lang/sdk/issues/40620
   Future<void> test_project_filterImports_enumValues() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 enum E {
   e,
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 export 'a.dart';
 ''');
 
@@ -354,13 +354,13 @@
 
   /// See: https://github.com/dart-lang/sdk/issues/40620
   Future<void> test_project_filterImports_namedConstructors() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   A.a();
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 export 'a.dart';
 ''');
 
@@ -383,11 +383,11 @@
   }
 
   Future<void> test_project_filterMultipleImports() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 export 'a.dart';
 ''');
 
@@ -411,7 +411,7 @@
   }
 
   Future<void> test_project_lib() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 enum E {
   e,
@@ -468,7 +468,7 @@
   }
 
   Future<void> test_project_lib_fields_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int f = 0;
 }
@@ -488,7 +488,7 @@
   }
 
   Future<void> test_project_lib_fields_static() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static int f = 0;
 }
@@ -511,7 +511,7 @@
   }
 
   Future<void> test_project_lib_getters_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int get g => 0;
 }
@@ -531,7 +531,7 @@
   }
 
   Future<void> test_project_lib_getters_static() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static int get g => 0;
 }
@@ -555,7 +555,7 @@
 
   /// See: https://github.com/dart-lang/sdk/issues/40626
   Future<void> test_project_lib_getters_topLevel() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int get g => 0;
 ''');
 
@@ -576,7 +576,7 @@
   }
 
   Future<void> test_project_lib_methods_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void foo() => 0;
 }
@@ -596,7 +596,7 @@
   }
 
   Future<void> test_project_lib_methods_static() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static void foo() => 0;
 }
@@ -616,11 +616,11 @@
   }
 
   Future<void> test_project_lib_multipleExports() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 export 'a.dart';
 ''');
 
@@ -643,7 +643,7 @@
   }
 
   Future<void> test_project_lib_setters_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   set s(int s) {}
 }
@@ -663,7 +663,7 @@
   }
 
   Future<void> test_project_lib_setters_static() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static set g(int g) {}
 }
@@ -684,7 +684,7 @@
 
   /// See: https://github.com/dart-lang/sdk/issues/40626
   Future<void> test_project_lib_setters_topLevel() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 set s(int s) {}
 ''');
 
@@ -707,7 +707,7 @@
   @FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/38739')
   Future<void>
       test_project_suggestionRelevance_constructorParameterType() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'b.dart';
 
 class A {
@@ -715,7 +715,7 @@
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 class O { }
 ''');
 
@@ -746,7 +746,7 @@
   }
 
   Future<void> test_project_suggestionRelevance_constructorsAndTypes() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A { }
 ''');
 
@@ -778,7 +778,7 @@
 
   /// See: https://github.com/dart-lang/sdk/issues/35529
   Future<void> test_project_suggestMixins() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 mixin M { }
 class A { }
 ''');
diff --git a/pkg/analysis_server/test/client/impl/completion_driver.dart b/pkg/analysis_server/test/client/impl/completion_driver.dart
index df8faf3..6695249 100644
--- a/pkg/analysis_server/test/client/impl/completion_driver.dart
+++ b/pkg/analysis_server/test/client/impl/completion_driver.dart
@@ -92,12 +92,12 @@
     if (offset != null) {
       expect(completionOffset, -1, reason: 'cannot supply offset and ^');
       completionOffset = offset;
-      server.newFile2(server.testFilePath, content);
+      server.newFile(server.testFilePath, content);
     } else {
       expect(completionOffset, isNot(equals(-1)), reason: 'missing ^');
       var nextOffset = content.indexOf('^', completionOffset + 1);
       expect(nextOffset, equals(-1), reason: 'too many ^');
-      server.newFile2(
+      server.newFile(
         server.testFilePath,
         content.substring(0, completionOffset) +
             content.substring(completionOffset + 1),
diff --git a/pkg/analysis_server/test/completion_test_support.dart b/pkg/analysis_server/test/completion_test_support.dart
index cba131c..cdf6b9b 100644
--- a/pkg/analysis_server/test/completion_test_support.dart
+++ b/pkg/analysis_server/test/completion_test_support.dart
@@ -84,10 +84,10 @@
 
     try {
       extraFiles?.forEach((String fileName, String content) {
-        newFile2(fileName, content);
+        newFile(fileName, content);
       });
 
-      newFile2(testFile.path, spec.source);
+      newFile(testFile.path, spec.source);
       completionOffset = spec.testLocation;
       await getSuggestions(
         path: testFile.path,
diff --git a/pkg/analysis_server/test/domain_analysis_test.dart b/pkg/analysis_server/test/domain_analysis_test.dart
index 5b6ffbe..d3b7ed2 100644
--- a/pkg/analysis_server/test/domain_analysis_test.dart
+++ b/pkg/analysis_server/test/domain_analysis_test.dart
@@ -36,14 +36,14 @@
   @override
   void setUp() {
     super.setUp();
-    newFile2('$workspaceRootPath/WORKSPACE', '');
+    newFile('$workspaceRootPath/WORKSPACE', '');
   }
 
   Future<void> test_fileSystem_changeFile_buildFile() async {
     // This BUILD file does not enable null safety.
     newBazelBuildFile(myPackageRootPath, '');
 
-    newFile2(myPackageTestFilePath, '''
+    newFile(myPackageTestFilePath, '''
 void f(int? a) {}
 ''');
 
@@ -107,7 +107,7 @@
     var a_path = '$testPackageLibPath/a.dart';
     var options_path = '$testPackageRootPath/analysis_options.yaml';
 
-    newFile2(a_path, 'error');
+    newFile(a_path, 'error');
 
     await setRoots(included: [workspaceRootPath], excluded: []);
     await server.onAnalysisComplete;
@@ -119,7 +119,7 @@
     );
 
     // Add 'analysis_options.yaml' that has an error.
-    newFile2(options_path, '''
+    newFile(options_path, '''
 analyzer:
   error:
 ''');
@@ -136,7 +136,7 @@
   Future<void> test_fileSystem_addFile_androidManifestXml() async {
     var path = '$testPackageRootPath/AndroidManifest.xml';
 
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
 
     newAnalysisOptionsYamlFile2(testPackageRootPath, '''
 analyzer:
@@ -146,7 +146,7 @@
 
     await setRoots(included: [workspaceRootPath], excluded: []);
 
-    newFile2(path, '<manifest/>');
+    newFile(path, '<manifest/>');
     await pumpEventQueue();
     await server.onAnalysisComplete;
 
@@ -178,7 +178,7 @@
     var a_path = '$testPackageLibPath/.foo/a.dart';
     var b_path = '$testPackageLibPath/b.dart';
 
-    newFile2(b_path, r'''
+    newFile(b_path, r'''
 import '.foo/a.dart';
 void f(A a) {}
 ''');
@@ -189,7 +189,7 @@
     // We don't have a.dart, so the import cannot be resolved.
     assertHasErrors(b_path);
 
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 class A {}
 ''');
     await pumpEventQueue();
@@ -212,7 +212,7 @@
     - "**/a.dart"
 ''');
 
-    newFile2(b_path, r'''
+    newFile(b_path, r'''
 import 'a.dart';
 void f(A a) {}
 ''');
@@ -223,7 +223,7 @@
     // We don't have a.dart, so the import cannot be resolved.
     assertHasErrors(b_path);
 
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 class A {}
 ''');
     await pumpEventQueue();
@@ -239,7 +239,7 @@
   Future<void> test_fileSystem_addFile_fixDataYaml() async {
     var path = '$testPackageLibPath/fix_data.yaml';
 
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
 
     await setRoots(included: [workspaceRootPath], excluded: []);
 
@@ -247,7 +247,7 @@
     assertNoErrorsNotification(path);
 
     // Create it, will be analyzed.
-    newFile2(path, '0: 1');
+    newFile(path, '0: 1');
     await pumpEventQueue();
     await server.onAnalysisComplete;
 
@@ -262,11 +262,11 @@
     var aaaRootPath = '/packages/aaa';
     var a_path = '$aaaRootPath/lib/a.dart';
 
-    newFile2(a_path, '''
+    newFile(a_path, '''
 class A {}
 ''');
 
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 import 'package:aaa/a.dart';
 void f(A a) {}
 ''');
@@ -297,7 +297,7 @@
     var a_path = '$testPackageLibPath/a.dart';
     var pubspec_path = '$testPackageRootPath/pubspec.yaml';
 
-    newFile2(a_path, 'error');
+    newFile(a_path, 'error');
 
     // Write an empty file to force a new analysis context.
     // We look for `pubspec.yaml` files only in analysis context roots.
@@ -313,7 +313,7 @@
     );
 
     // Add a non-Dart file that we know how to analyze.
-    newFile2(pubspec_path, '''
+    newFile(pubspec_path, '''
 name: sample
 dependencies: true
 ''');
@@ -331,7 +331,7 @@
     var a_path = '$testPackageLibPath/a.dart';
     var unrelated_path = '$testPackageRootPath/unrelated.txt';
 
-    newFile2(a_path, 'error');
+    newFile(a_path, 'error');
 
     await setRoots(included: [workspaceRootPath], excluded: []);
     await server.onAnalysisComplete;
@@ -343,7 +343,7 @@
     );
 
     // Add an unrelated file, no analysis.
-    newFile2(unrelated_path, 'anything');
+    newFile(unrelated_path, 'anything');
     await pumpEventQueue();
     await server.onAnalysisComplete;
 
@@ -361,7 +361,7 @@
     _createFilesWithErrors([a_path, b_path, c_path]);
 
     // Exclude b.dart from analysis.
-    newFile2(options_path, r'''
+    newFile(options_path, r'''
 analyzer:
   exclude:
     - lib/b.dart
@@ -377,7 +377,7 @@
     );
 
     // Exclude c.dart from analysis.
-    newFile2(options_path, r'''
+    newFile(options_path, r'''
 analyzer:
   exclude:
     - lib/c.dart
@@ -398,10 +398,10 @@
   Future<void> test_fileSystem_changeFile_androidManifestXml() async {
     var path = '$testPackageRootPath/AndroidManifest.xml';
 
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
 
     // Has an error - no touch screen.
-    newFile2(path, '<manifest/>');
+    newFile(path, '<manifest/>');
 
     newAnalysisOptionsYamlFile2(testPackageRootPath, '''
 analyzer:
@@ -416,7 +416,7 @@
     assertNoErrorsNotification(path);
 
     // Update the file, so analyze it.
-    newFile2(path, '<manifest/>');
+    newFile(path, '<manifest/>');
     await pumpEventQueue();
     await server.onAnalysisComplete;
 
@@ -428,11 +428,11 @@
     var a_path = '$testPackageLibPath/a.dart';
     var b_path = '$testPackageLibPath/b.dart';
 
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 class A2 {}
 ''');
 
-    newFile2(b_path, r'''
+    newFile(b_path, r'''
 import 'a.dart';
 void f(A a) {}
 ''');
@@ -445,7 +445,7 @@
     forgetReceivedErrors();
 
     // Update a.dart so that b.dart has no error.
-    newFile2(a_path, 'class A {}');
+    newFile(a_path, 'class A {}');
     await pumpEventQueue();
     await server.onAnalysisComplete;
 
@@ -458,11 +458,11 @@
     var a_path = '$testPackageLibPath/.foo/a.dart';
     var b_path = '$testPackageLibPath/b.dart';
 
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 class B {}
 ''');
 
-    newFile2(b_path, r'''
+    newFile(b_path, r'''
 import '.foo/a.dart';
 void f(A a) {}
 ''');
@@ -477,7 +477,7 @@
     // We have `B`, not `A`, in a.dart, so has errors.
     assertHasErrors(b_path);
 
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 class A {}
 ''');
     await pumpEventQueue();
@@ -500,11 +500,11 @@
     - "**/a.dart"
 ''');
 
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 class B {}
 ''');
 
-    newFile2(b_path, r'''
+    newFile(b_path, r'''
 import 'a.dart';
 void f(A a) {}
 ''');
@@ -519,7 +519,7 @@
     // We have `B`, not `A`, in a.dart, so has errors.
     assertHasErrors(b_path);
 
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 class A {}
 ''');
     await pumpEventQueue();
@@ -532,10 +532,10 @@
   Future<void> test_fileSystem_changeFile_fixDataYaml() async {
     var path = '$testPackageLibPath/fix_data.yaml';
 
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
 
     // This file has an error.
-    newFile2(path, '0: 1');
+    newFile(path, '0: 1');
 
     await setRoots(included: [workspaceRootPath], excluded: []);
 
@@ -543,7 +543,7 @@
     assertHasErrors(path);
 
     // Replace with the context that does not have errors.
-    newFile2(path, r'''
+    newFile(path, r'''
 version: 1
 transforms: []
 ''');
@@ -558,7 +558,7 @@
   }
 
   Future<void> test_fileSystem_changeFile_hasOverlay_removeOverlay() async {
-    newFile2(testFilePath, '');
+    newFile(testFilePath, '');
 
     // Add an overlay without errors.
     await handleSuccessfulRequest(
@@ -578,7 +578,7 @@
     );
 
     // Change the file, has errors.
-    newFile2(testFilePath, 'error');
+    newFile(testFilePath, 'error');
 
     // But the overlay is still present, so the file is not analyzed.
     await _waitAnalysisComplete();
@@ -611,7 +611,7 @@
     // Use long delay, so that it does not happen.
     server.pendingFilesRemoveOverlayDelay = const Duration(seconds: 300);
 
-    newFile2(testFilePath, '');
+    newFile(testFilePath, '');
 
     // Add an overlay without errors.
     await handleSuccessfulRequest(
@@ -655,7 +655,7 @@
     );
 
     // Change the file again, has errors.
-    newFile2(testFilePath, 'error');
+    newFile(testFilePath, 'error');
 
     // The timer cancelled on the watch event, and the file analyzed.
     await _waitAnalysisComplete();
@@ -670,11 +670,11 @@
     var aaaRootPath = '/packages/aaa';
     var a_path = '$aaaRootPath/lib/a.dart';
 
-    newFile2(a_path, '''
+    newFile(a_path, '''
 class A {}
 ''');
 
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 import 'package:aaa/a.dart';
 void f(A a) {}
 ''');
@@ -710,7 +710,7 @@
     _createFilesWithErrors([a_path, b_path]);
 
     // Exclude b.dart from analysis.
-    newFile2(options_path, r'''
+    newFile(options_path, r'''
 analyzer:
   exclude:
     - lib/b.dart
@@ -742,10 +742,10 @@
   Future<void> test_fileSystem_deleteFile_androidManifestXml() async {
     var path = '$testPackageRootPath/AndroidManifest.xml';
 
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
 
     // Has an error - no touch screen.
-    newFile2(path, '<manifest/>');
+    newFile(path, '<manifest/>');
 
     newAnalysisOptionsYamlFile2(testPackageRootPath, '''
 analyzer:
@@ -796,11 +796,11 @@
     - "**/a.dart"
 ''');
 
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 class A {}
 ''');
 
-    newFile2(b_path, r'''
+    newFile(b_path, r'''
 import 'a.dart';
 void f(A a) {}
 ''');
@@ -826,10 +826,10 @@
   Future<void> test_fileSystem_deleteFile_fixDataYaml() async {
     var path = '$testPackageLibPath/fix_data.yaml';
 
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
 
     // This file has an error.
-    newFile2(path, '0: 1');
+    newFile(path, '0: 1');
 
     await setRoots(included: [workspaceRootPath], excluded: []);
 
@@ -848,7 +848,7 @@
     var aaaRootPath = '/packages/aaa';
     var a_path = '$aaaRootPath/lib/a.dart';
 
-    newFile2(a_path, '''
+    newFile(a_path, '''
 class A {}
 ''');
 
@@ -858,7 +858,7 @@
         ..add(name: 'aaa', rootPath: aaaRootPath),
     );
 
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 import 'package:aaa/a.dart';
 void f(A a) {}
 ''');
@@ -892,7 +892,7 @@
     // Use long delay, so that it does not happen.
     server.pendingFilesRemoveOverlayDelay = const Duration(seconds: 300);
 
-    newFile2(testFilePath, '');
+    newFile(testFilePath, '');
 
     // Add an overlay without errors.
     await handleSuccessfulRequest(
@@ -1228,10 +1228,10 @@
     var a_path = '$testPackageLibPath/a.dart';
     var options_path = '$testPackageRootPath/analysis_options.yaml';
 
-    newFile2(a_path, 'error');
+    newFile(a_path, 'error');
 
     // 'analysis_options.yaml' that has an error and excludes itself.
-    newFile2(options_path, '''
+    newFile(options_path, '''
 analyzer:
   exclude:
     - analysis_options.yaml
@@ -1250,7 +1250,7 @@
   Future<void> test_setRoots_notDartFile_androidManifestXml() async {
     var path = '$testPackageRootPath/AndroidManifest.xml';
 
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
 
     newAnalysisOptionsYamlFile2(testPackageRootPath, '''
 analyzer:
@@ -1258,7 +1258,7 @@
     chrome-os-manifest-checks: true
 ''');
 
-    newFile2(path, '<manifest/>');
+    newFile(path, '<manifest/>');
 
     await setRoots(included: [workspaceRootPath], excluded: []);
 
@@ -1270,7 +1270,7 @@
     var path = '$testPackageLibPath/fix_data.yaml';
 
     // `lib/fix_data.yaml` will be analyzed.
-    newFile2(path, '0: 1');
+    newFile(path, '0: 1');
 
     await setRoots(included: [workspaceRootPath], excluded: []);
 
@@ -1283,7 +1283,7 @@
     var pubspec_path = '$testPackageRootPath/pubspec.yaml';
     var options_path = '$testPackageRootPath/analysis_options.yaml';
 
-    newFile2(a_path, 'error');
+    newFile(a_path, 'error');
 
     writeTestPackagePubspecYamlFile('''
 name:
@@ -1291,7 +1291,7 @@
 ''');
 
     // 'analysis_options.yaml' that excludes pubspec.yaml.
-    newFile2(options_path, '''
+    newFile(options_path, '''
 analyzer:
   exclude:
     - pubspec.yaml
@@ -1310,7 +1310,7 @@
     var aaaRootPath = '/packages/aaa';
     var a_path = '$aaaRootPath/lib/a.dart';
 
-    newFile2(a_path, '''
+    newFile(a_path, '''
 class A {}
 ''');
 
@@ -1319,7 +1319,7 @@
         ..add(name: 'aaa', rootPath: aaaRootPath),
     );
 
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 import 'package:aaa/a.dart';
 void f(A a) {}
 ''');
@@ -1336,7 +1336,7 @@
   }
 
   Future<void> test_updateContent_addOverlay() async {
-    newFile2(testFilePath, 'error');
+    newFile(testFilePath, 'error');
 
     await setRoots(included: [workspaceRootPath], excluded: []);
 
@@ -1365,7 +1365,7 @@
   }
 
   Future<void> test_updateContent_changeOverlay() async {
-    newFile2(testFilePath, '');
+    newFile(testFilePath, '');
 
     // Add the content with an error.
     await handleSuccessfulRequest(
@@ -1427,7 +1427,7 @@
     String initialContent,
     SourceEdit edit,
   ) async {
-    newFile2(testFilePath, initialContent);
+    newFile(testFilePath, initialContent);
 
     await setRoots(included: [workspaceRootPath], excluded: []);
     await server.onAnalysisComplete;
@@ -1512,7 +1512,7 @@
   }
 
   Future<void> test_afterAnalysis_packageFile_external() async {
-    var pkgFile = newFile2('/packages/pkgA/lib/libA.dart', '''
+    var pkgFile = newFile('/packages/pkgA/lib/libA.dart', '''
 library lib_a;
 class A {}
 ''');
@@ -1542,11 +1542,11 @@
   Future<void> test_afterAnalysis_packageFile_inRoot() async {
     var pkgA = convertPath('/pkgA');
     var pkgB = convertPath('/pkgA');
-    var pkgFileA = newFile2('$pkgA/lib/libA.dart', '''
+    var pkgFileA = newFile('$pkgA/lib/libA.dart', '''
 library lib_a;
 class A {}
 ''');
-    newFile2('$pkgA/lib/libB.dart', '''
+    newFile('$pkgA/lib/libB.dart', '''
 import 'package:pkgA/libA.dart';
 main() {
   new A();
@@ -1565,7 +1565,7 @@
   }
 
   Future<void> test_afterAnalysis_packageFile_notUsed() async {
-    var pkgFile = newFile2('/packages/pkgA/lib/libA.dart', '''
+    var pkgFile = newFile('/packages/pkgA/lib/libA.dart', '''
 library lib_a;
 class A {}
 ''');
@@ -1695,7 +1695,7 @@
   /// So, when analyzed, these files will satisfy [assertHasErrors].
   void _createFilesWithErrors(List<String> paths) {
     for (var path in paths) {
-      newFile2(path, 'error');
+      newFile(path, 'error');
     }
   }
 }
diff --git a/pkg/analysis_server/test/domain_completion_test.dart b/pkg/analysis_server/test/domain_completion_test.dart
index 78c3b52..7c0b975 100644
--- a/pkg/analysis_server/test/domain_completion_test.dart
+++ b/pkg/analysis_server/test/domain_completion_test.dart
@@ -78,7 +78,7 @@
 ''');
 
     var aaaRoot = getFolder('$workspaceRootPath/packages/aaa');
-    newFile2('${aaaRoot.path}/lib/f.dart', '''
+    newFile('${aaaRoot.path}/lib/f.dart', '''
 class Test {}
 ''');
 
@@ -109,7 +109,7 @@
   }
 
   Future<void> test_import_package_this() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class Test {}
 ''');
 
@@ -174,7 +174,7 @@
     var nextOffset = content.indexOf('^', completionOffset + 1);
     expect(nextOffset, equals(-1), reason: 'too many ^');
 
-    newFile2(
+    newFile(
         path,
         content.substring(0, completionOffset) +
             content.substring(completionOffset + 1));
@@ -233,7 +233,7 @@
       abortedIdSet.add(request.id);
     });
 
-    newFile2(testFilePath, '');
+    newFile(testFilePath, '');
 
     await _configureWithWorkspaceRoot();
 
@@ -271,7 +271,7 @@
       abortedIdSet.add(request.id);
     });
 
-    newFile2(testFilePath, '');
+    newFile(testFilePath, '');
 
     await _configureWithWorkspaceRoot();
 
@@ -312,13 +312,13 @@
   }
 
   Future<void> test_isNotImportedFeature_prefixed_classInstanceMethod() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   void foo01() {}
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart';
 
 class B extends A {
@@ -392,13 +392,13 @@
   }
 
   Future<void> test_notImported_lowerRelevance_enumConstant() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 enum E1 {
   foo01
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 enum E2 {
   foo02
 }
@@ -432,13 +432,13 @@
   Future<void> test_notImported_lowerRelevance_extension_getter() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 extension E1 on int {
   int get foo01 => 0;
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 extension E2 on int {
   int get foo02 => 0;
 }
@@ -470,13 +470,13 @@
   Future<void> test_notImported_lowerRelevance_extension_method() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 extension E1 on int {
   void foo01() {}
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 extension E2 on int {
   void foo02() {}
 }
@@ -508,13 +508,13 @@
   Future<void> test_notImported_lowerRelevance_extension_setter() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 extension E1 on int {
   set foo01(int _) {}
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 extension E2 on int {
   set foo02(int _) {}
 }
@@ -544,11 +544,11 @@
   }
 
   Future<void> test_notImported_lowerRelevance_topLevel_class() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A01 {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 class A02 {}
 ''');
 
@@ -578,11 +578,11 @@
   }
 
   Future<void> test_notImported_lowerRelevance_topLevel_getter() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 int get foo01 => 0;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 int get foo02 => 0;
 ''');
 
@@ -612,11 +612,11 @@
   }
 
   Future<void> test_notImported_lowerRelevance_topLevel_setter() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 set foo01(int _) {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 set foo02(int _) {}
 ''');
 
@@ -646,11 +646,11 @@
   }
 
   Future<void> test_notImported_lowerRelevance_topLevel_variable() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 var foo01 = 0;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 var foo02 = 0;
 ''');
 
@@ -689,18 +689,18 @@
 ''');
 
     var aaaRoot = getFolder('$workspaceRootPath/packages/aaa');
-    newFile2('${aaaRoot.path}/lib/f.dart', '''
+    newFile('${aaaRoot.path}/lib/f.dart', '''
 class A01 {}
 ''');
-    newFile2('${aaaRoot.path}/lib/src/f.dart', '''
+    newFile('${aaaRoot.path}/lib/src/f.dart', '''
 class A02 {}
 ''');
 
     var bbbRoot = getFolder('$workspaceRootPath/packages/bbb');
-    newFile2('${bbbRoot.path}/lib/f.dart', '''
+    newFile('${bbbRoot.path}/lib/f.dart', '''
 class A03 {}
 ''');
-    newFile2('${bbbRoot.path}/lib/src/f.dart', '''
+    newFile('${bbbRoot.path}/lib/src/f.dart', '''
 class A04 {}
 ''');
 
@@ -739,18 +739,18 @@
 ''');
 
     var aaaRoot = getFolder('$workspaceRootPath/packages/aaa');
-    newFile2('${aaaRoot.path}/lib/f.dart', '''
+    newFile('${aaaRoot.path}/lib/f.dart', '''
 class A01 {}
 ''');
-    newFile2('${aaaRoot.path}/lib/src/f.dart', '''
+    newFile('${aaaRoot.path}/lib/src/f.dart', '''
 class A02 {}
 ''');
 
     var bbbRoot = getFolder('$workspaceRootPath/packages/bbb');
-    newFile2('${bbbRoot.path}/lib/f.dart', '''
+    newFile('${bbbRoot.path}/lib/f.dart', '''
 class A03 {}
 ''');
-    newFile2('${bbbRoot.path}/lib/src/f.dart', '''
+    newFile('${bbbRoot.path}/lib/src/f.dart', '''
 class A04 {}
 ''');
 
@@ -787,11 +787,11 @@
   }
 
   Future<void> test_notImported_pub_this() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A01 {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 class A02 {}
 ''');
 
@@ -818,12 +818,12 @@
   }
 
   Future<void> test_notImported_pub_this_hasImport() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A01 {}
 class A02 {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 class A03 {}
 ''');
 
@@ -855,12 +855,12 @@
   }
 
   Future<void> test_notImported_pub_this_hasImport_hasShow() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A01 {}
 class A02 {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 class A03 {}
 ''');
 
@@ -900,11 +900,11 @@
 name: test
 ''');
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A01 {}
 ''');
 
-    newFile2('$testPackageTestPath/b.dart', '''
+    newFile('$testPackageTestPath/b.dart', '''
 class A02 {}
 ''');
 
@@ -932,11 +932,11 @@
 name: test
 ''');
 
-    newFile2('$testPackageLibPath/f.dart', '''
+    newFile('$testPackageLibPath/f.dart', '''
 class A01 {}
 ''');
 
-    newFile2('$testPackageLibPath/src/f.dart', '''
+    newFile('$testPackageLibPath/src/f.dart', '''
 class A02 {}
 ''');
 
@@ -967,11 +967,11 @@
 name: test
 ''');
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A01 {}
 ''');
 
-    var b = newFile2('$testPackageTestPath/b.dart', '''
+    var b = newFile('$testPackageTestPath/b.dart', '''
 class A02 {}
 ''');
     var b_uriStr = toUriStr(b.path);
@@ -1007,11 +1007,11 @@
 name: test
 ''');
 
-    newFile2('$testPackageLibPath/f.dart', '''
+    newFile('$testPackageLibPath/f.dart', '''
 class A01 {}
 ''');
 
-    newFile2('$testPackageLibPath/src/f.dart', '''
+    newFile('$testPackageLibPath/src/f.dart', '''
 class A02 {}
 ''');
 
@@ -1100,7 +1100,7 @@
   Future<void> test_numResults_topLevelVariables_imported_withPrefix() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 var foo01 = 0;
 var foo02 = 0;
 var foo03 = 0;
@@ -1280,7 +1280,7 @@
   Future<void> test_prefixed_expression_extensionGetters_notImported() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 extension E1 on int {
   int get foo01 => 0;
   int get bar => 0;
@@ -1321,7 +1321,7 @@
       test_prefixed_expression_extensionGetters_notImported_private() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 extension E1 on int {
   int get foo01 => 0;
 }
@@ -1389,7 +1389,7 @@
   Future<void> test_prefixed_expression_extensionMethods_notImported() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 extension E1 on int {
   void foo01() {}
   void bar() {}
@@ -1462,7 +1462,7 @@
   Future<void> test_prefixed_expression_extensionSetters_notImported() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 extension E1 on int {
   set foo01(int _) {}
   set bar(int _) {}
@@ -1503,7 +1503,7 @@
       test_prefixed_expression_extensionSetters_notImported_private() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 extension E1 on int {
   set foo01(int _) {}
 }
@@ -1538,7 +1538,7 @@
   Future<void> test_prefixed_extensionGetters_imported() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 extension E1 on int {
   int get foo01 => 0;
   int get foo02 => 0;
@@ -1682,11 +1682,11 @@
   Future<void> test_unprefixed_imported_class() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A01 {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 class A02 {}
 ''');
 
@@ -1720,11 +1720,11 @@
   Future<void> test_unprefixed_imported_topLevelVariable() async {
     await _configureWithWorkspaceRoot();
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 var foo01 = 0;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 var foo02 = 0;
 ''');
 
@@ -1927,7 +1927,7 @@
     var nextOffset = content.indexOf('^', completionOffset + 1);
     expect(nextOffset, equals(-1), reason: 'too many ^');
 
-    newFile2(
+    newFile(
       path,
       content.substring(0, completionOffset) +
           content.substring(completionOffset + 1),
@@ -2233,7 +2233,7 @@
   Future<void> test_import_uri_with_trailing() async {
     final filePath = '/project/bin/testA.dart';
     final incompleteImportText = toUriStr('/project/bin/t');
-    newFile2(filePath, 'library libA;');
+    newFile(filePath, 'library libA;');
     await getTestCodeSuggestions('''
     import "$incompleteImportText^.dart";
     void f() {}''');
@@ -2525,7 +2525,7 @@
   }
 
   Future<void> test_inDartDoc_reference1() async {
-    newFile2('/testA.dart', '''
+    newFile('/testA.dart', '''
   part of libA;
   foo(bar) => 0;''');
     await getTestCodeSuggestions('''
@@ -2666,7 +2666,7 @@
   }
 
   Future<void> test_local_override() async {
-    newFile2('/project/bin/a.dart', 'class A {m() {}}');
+    newFile('/project/bin/a.dart', 'class A {m() {}}');
     await getTestCodeSuggestions('''
 import 'a.dart';
 class B extends A {
@@ -2730,7 +2730,7 @@
   }
 
   Future<void> test_overrides() async {
-    newFile2('/project/bin/a.dart', 'class A {m() {}}');
+    newFile('/project/bin/a.dart', 'class A {m() {}}');
     await getTestCodeSuggestions('''
 import 'a.dart';
 class B extends A {m() {^}}
@@ -2741,7 +2741,7 @@
   }
 
   Future<void> test_partFile() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
       library libA;
       import 'dart:html';
       part 'test.dart';
@@ -2762,7 +2762,7 @@
   }
 
   Future<void> test_partFile2() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
       part of libA;
       class A { }''');
     await getTestCodeSuggestions('''
diff --git a/pkg/analysis_server/test/domain_completion_util.dart b/pkg/analysis_server/test/domain_completion_util.dart
index 19086f3..183b2c6 100644
--- a/pkg/analysis_server/test/domain_completion_util.dart
+++ b/pkg/analysis_server/test/domain_completion_util.dart
@@ -86,7 +86,7 @@
     var nextOffset = content.indexOf('^', completionOffset + 1);
     expect(nextOffset, equals(-1), reason: 'too many ^');
 
-    newFile2(
+    newFile(
       path,
       content.substring(0, completionOffset) +
           content.substring(completionOffset + 1),
diff --git a/pkg/analysis_server/test/domain_diagnostic_test.dart b/pkg/analysis_server/test/domain_diagnostic_test.dart
index bffbea1..892f0b5 100644
--- a/pkg/analysis_server/test/domain_diagnostic_test.dart
+++ b/pkg/analysis_server/test/domain_diagnostic_test.dart
@@ -18,7 +18,7 @@
 class DiagnosticDomainTest extends PubPackageAnalysisServerTest {
   Future<void> test_getDiagnostics() async {
     newPubspecYamlFile(testPackageRootPath, 'name: project');
-    newFile2('$testPackageLibPath/test.dart', 'main() {}');
+    newFile('$testPackageLibPath/test.dart', 'main() {}');
 
     await setRoots(included: [workspaceRootPath], excluded: []);
     await server.onAnalysisComplete;
diff --git a/pkg/analysis_server/test/domain_execution_test.dart b/pkg/analysis_server/test/domain_execution_test.dart
index ce4b54c..a9f288c 100644
--- a/pkg/analysis_server/test/domain_execution_test.dart
+++ b/pkg/analysis_server/test/domain_execution_test.dart
@@ -178,8 +178,8 @@
 }
 ''';
 
-    var path = newFile2('/test.dart', '').path;
-    newFile2(path, code);
+    var path = newFile('/test.dart', '').path;
+    newFile(path, code);
 
     var request = ExecutionGetSuggestionsParams(
         'a.',
@@ -203,7 +203,7 @@
   }
 
   Future<void> test_mapUri_file() async {
-    var path = newFile2('/a/b.dart', '').path;
+    var path = newFile('/a/b.dart', '').path;
     // map the file
     var result = await _mapUri(file: path);
     expect(result.file, isNull);
@@ -219,7 +219,7 @@
   }
 
   Future<void> test_mapUri_uri() async {
-    var path = newFile2('/a/b.dart', '').path;
+    var path = newFile('/a/b.dart', '').path;
     // map the uri
     var result = await _mapUri(uri: Uri.file(path).toString());
     expect(result.file, convertPath('/a/b.dart'));
diff --git a/pkg/analysis_server/test/edit/bulk_fixes_test.dart b/pkg/analysis_server/test/edit/bulk_fixes_test.dart
index cc90c1f..a239941 100644
--- a/pkg/analysis_server/test/edit/bulk_fixes_test.dart
+++ b/pkg/analysis_server/test/edit/bulk_fixes_test.dart
@@ -67,7 +67,7 @@
     - annotate_overrides
 ''');
 
-    newFile2('$testPackageRootPath/test/test.dart', '''
+    newFile('$testPackageRootPath/test/test.dart', '''
 class A {
   void f() {}
 }
@@ -99,7 +99,7 @@
 name: subproject
 ''');
 
-    newFile2('$subprojectRoot/test.dart', '''
+    newFile('$subprojectRoot/test.dart', '''
 class A {
   void f() {}
 }
@@ -123,7 +123,7 @@
 name: subproject
 ''');
 
-    var file = newFile2('$subprojectRoot/test.dart', '''
+    var file = newFile('$subprojectRoot/test.dart', '''
 class A {
   void f() {}
 }
@@ -153,7 +153,7 @@
     - unnecessary_new
 ''');
 
-    var a = newFile2('$testPackageLibPath/a.dart', '''
+    var a = newFile('$testPackageLibPath/a.dart', '''
 class A {
   A f() => new A();
 }
diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
index 95af965..c000778 100644
--- a/pkg/analysis_server/test/edit/fixes_test.dart
+++ b/pkg/analysis_server/test/edit/fixes_test.dart
@@ -32,7 +32,7 @@
 
   Future<void> test_fileOutsideRoot() async {
     final outsideFile = '/foo/test.dart';
-    newFile2(outsideFile, 'bad code to create error');
+    newFile(outsideFile, 'bad code to create error');
 
     // Set up the original project, as the code fix code won't run at all
     // if there are no contexts.
@@ -166,15 +166,15 @@
             ..add(name: 'bbb', rootPath: '$workspaceRootPath/bbb'))
           .toContent(toUriStr: toUriStr),
     );
-    newFile2('$workspaceRootPath/bbb/lib/target.dart', 'class Foo() {}');
-    newFile2(
+    newFile('$workspaceRootPath/bbb/lib/target.dart', 'class Foo() {}');
+    newFile(
         '$workspaceRootPath/bbb/lib/target.generated.dart', 'class Foo() {}');
-    newFile2(
+    newFile(
         '$workspaceRootPath/bbb/lib/target.template.dart', 'class Foo() {}');
 
     // Configure the test file.
     final file =
-        newFile2('$workspaceRootPath/aaa/main.dart', 'main() { new Foo(); }');
+        newFile('$workspaceRootPath/aaa/main.dart', 'main() { new Foo(); }');
 
     await waitForTasksFinished();
 
diff --git a/pkg/analysis_server/test/edit/format_if_enabled_test.dart b/pkg/analysis_server/test/edit/format_if_enabled_test.dart
index 0d6a3b0..8d0d6bb 100644
--- a/pkg/analysis_server/test/edit/format_if_enabled_test.dart
+++ b/pkg/analysis_server/test/edit/format_if_enabled_test.dart
@@ -31,7 +31,7 @@
     addTestFile('''
 void f() { int x = 3; }
 ''');
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A { A(); }
 ''');
     var edits = await _format();
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index df8fe1c..eef47df 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -269,7 +269,7 @@
 
   Future<void> test_analysis_onlyOneFile() async {
     shouldWaitForFullAnalysis = false;
-    newFile2('$testPackageLibPath/other.dart', r'''
+    newFile('$testPackageLibPath/other.dart', r'''
 foo(int myName) {}
 ''');
     addTestFile('''
@@ -471,7 +471,7 @@
 
   Future<void> test_resetOnAnalysisSetChanged_watch_otherFile() async {
     var otherFile = join('$testPackageLibPath/other.dart');
-    newFile2(otherFile, '// other 1');
+    newFile(otherFile, '// other 1');
     addTestFile('''
 void f() {
   foo(1 + 2);
@@ -491,7 +491,7 @@
     // The refactoring is reset, even though it's a different file. It is up to
     // analyzer to track dependencies and provide resolved units fast when
     // possible.
-    newFile2(otherFile, '// other 2');
+    newFile(otherFile, '// other 2');
     await pumpEventQueue();
     expect(test_resetCount, initialResetCount + 1);
   }
@@ -1091,7 +1091,7 @@
 class InlineLocalTest extends _AbstractGetRefactoring_Test {
   Future<void> test_analysis_onlyOneFile() async {
     shouldWaitForFullAnalysis = false;
-    newFile2('$testPackageLibPath/other.dart', r'''
+    newFile('$testPackageLibPath/other.dart', r'''
 foo(int p) {}
 ''');
     addTestFile('''
@@ -1159,7 +1159,7 @@
   }
 
   Future<void> test_resetOnAnalysisSetChanged() async {
-    newFile2('$testPackageLibPath/other.dart', '// other 1');
+    newFile('$testPackageLibPath/other.dart', '// other 1');
     addTestFile('''
 void f() {
   int res = 1 + 2;
@@ -1321,7 +1321,7 @@
   late MoveFileOptions options;
 
   Future<void> test_file_OK() {
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
     addTestFile('''
 import 'dart:math';
 import 'a.dart';
@@ -1336,7 +1336,7 @@
   }
 
   Future<void> test_folder_cancel() {
-    newFile2('$testPackageLibPath/original_folder/file.dart', '');
+    newFile('$testPackageLibPath/original_folder/file.dart', '');
     addTestFile('''
 import 'dart:math';
 import 'original_folder/file.dart';
@@ -1349,7 +1349,7 @@
   }
 
   Future<void> test_folder_OK() {
-    newFile2('$testPackageLibPath/original_folder/file.dart', '');
+    newFile('$testPackageLibPath/original_folder/file.dart', '');
     addTestFile('''
 import 'dart:math';
 import 'original_folder/file.dart';
@@ -2133,7 +2133,7 @@
   }
 
   Future<void> test_library_partOfDirective() {
-    newFile2('$testPackageLibPath/my_lib.dart', '''
+    newFile('$testPackageLibPath/my_lib.dart', '''
 library aaa.bbb.ccc;
 part 'test.dart';
 ''');
diff --git a/pkg/analysis_server/test/lsp/analyzer_status_test.dart b/pkg/analysis_server/test/lsp/analyzer_status_test.dart
index 151158d..b7c9b792 100644
--- a/pkg/analysis_server/test/lsp/analyzer_status_test.dart
+++ b/pkg/analysis_server/test/lsp/analyzer_status_test.dart
@@ -39,7 +39,7 @@
 
   Future<void> test_afterDocumentEdits() async {
     const initialContents = 'int a = 1;';
-    newFile2(mainFilePath, initialContents);
+    newFile(mainFilePath, initialContents);
 
     final initialAnalysis = waitForAnalysisComplete();
 
@@ -61,7 +61,7 @@
 
   Future<void> test_afterInitialize() async {
     const initialContents = 'int a = 1;';
-    newFile2(mainFilePath, initialContents);
+    newFile(mainFilePath, initialContents);
 
     // To avoid races, set up listeners for the notifications before we initialise
     // and track which event came first to ensure they arrived in the expected
diff --git a/pkg/analysis_server/test/lsp/change_workspace_folders_test.dart b/pkg/analysis_server/test/lsp/change_workspace_folders_test.dart
index cddb554..0691f6e 100644
--- a/pkg/analysis_server/test/lsp/change_workspace_folders_test.dart
+++ b/pkg/analysis_server/test/lsp/change_workspace_folders_test.dart
@@ -74,7 +74,7 @@
         join(workspaceFolder1Path, 'nested', 'deeply', 'in', 'folders');
     final nestedFilePath = join(nestedFolderPath, 'test.dart');
     final nestedFileUri = Uri.file(nestedFilePath);
-    newFile2(nestedFilePath, '');
+    newFile(nestedFilePath, '');
 
     await initialize(allowEmptyRootUri: true);
     await openFile(nestedFileUri, '');
@@ -111,7 +111,7 @@
         join(workspaceFolder1Path, 'nested', 'deeply', 'in', 'folders');
     final nestedFilePath = join(nestedFolderPath, 'test.dart');
     final nestedFileUri = Uri.file(nestedFilePath);
-    newFile2(nestedFilePath, '');
+    newFile(nestedFilePath, '');
 
     await initialize(allowEmptyRootUri: true);
     await openFile(nestedFileUri, '');
@@ -149,7 +149,7 @@
         join(workspaceFolder1Path, 'nested', 'deeply', 'in', 'folders');
     final nestedFilePath = join(nestedFolderPath, 'test.dart');
     final nestedFileUri = Uri.file(nestedFilePath);
-    newFile2(nestedFilePath, '');
+    newFile(nestedFilePath, '');
 
     await initialize(workspaceFolders: [workspaceFolder1Uri]);
 
@@ -184,7 +184,7 @@
         join(workspaceFolder1Path, 'nested', 'deeply', 'in', 'folders');
     final nestedFilePath = join(nestedFolderPath, 'test.dart');
     final nestedFileUri = Uri.file(nestedFilePath);
-    newFile2(nestedFilePath, '');
+    newFile(nestedFilePath, '');
 
     await initialize(workspaceFolders: [workspaceFolder1Uri]);
 
@@ -220,7 +220,7 @@
         join(workspaceFolder1Path, 'nested', 'deeply', 'in', 'folders');
     final nestedFilePath = join(nestedFolderPath, 'test.dart');
     final nestedFileUri = Uri.file(nestedFilePath);
-    newFile2(nestedFilePath, '');
+    newFile(nestedFilePath, '');
 
     // Ensure no pubspecs in tree.
     deleteFile(
@@ -256,10 +256,10 @@
     // analysis driver will be used (see [AbstractAnalysisServer.getAnalysisDriver])
     // and no new root will be created.
     final workspace1FilePath = join(workspaceFolder1Path, 'test.dart');
-    newFile2(workspace1FilePath, '');
+    newFile(workspace1FilePath, '');
     final workspace2FilePath = join(workspaceFolder2Path, 'test.dart');
     final workspace2FileUri = Uri.file(workspace2FilePath);
-    newFile2(workspace2FilePath, '');
+    newFile(workspace2FilePath, '');
 
     await initialize(workspaceFolders: [workspaceFolder1Uri]);
 
@@ -309,7 +309,7 @@
 
     // Generate an error in the test project.
     final firstDiagnosticsUpdate = waitForDiagnostics(mainFileUri);
-    newFile2(mainFilePath, 'String a = 1;');
+    newFile(mainFilePath, 'String a = 1;');
     final initialDiagnostics = await firstDiagnosticsUpdate;
     expect(initialDiagnostics, hasLength(1));
 
diff --git a/pkg/analysis_server/test/lsp/code_actions_assists_test.dart b/pkg/analysis_server/test/lsp/code_actions_assists_test.dart
index 06d962f..21685a5 100644
--- a/pkg/analysis_server/test/lsp/code_actions_assists_test.dart
+++ b/pkg/analysis_server/test/lsp/code_actions_assists_test.dart
@@ -45,7 +45,7 @@
 
     Future f;
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -86,7 +86,7 @@
 
     Future f;
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -122,7 +122,7 @@
     // indicating this is not a valid (Dart) int.
     // https://github.com/dart-lang/sdk/issues/42786
 
-    newFile2(mainFilePath, '');
+    newFile(mainFilePath, '');
     await initialize();
 
     final request = makeRequest(
@@ -157,7 +157,7 @@
   }
 
   Future<void> test_nonDartFile() async {
-    newFile2(pubspecFilePath, simplePubspecContent);
+    newFile(pubspecFilePath, simplePubspecContent);
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -191,7 +191,7 @@
           request is plugin.EditGetAssistsParams ? pluginResult : null,
     );
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -228,7 +228,7 @@
           request is plugin.EditGetAssistsParams ? pluginResult : null,
     );
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -285,7 +285,7 @@
     }
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -357,7 +357,7 @@
     }
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -421,7 +421,7 @@
     }
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -463,7 +463,7 @@
     build() => Contai^ner(child: Container());
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -504,7 +504,7 @@
 }
 ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
diff --git a/pkg/analysis_server/test/lsp/code_actions_fixes_test.dart b/pkg/analysis_server/test/lsp/code_actions_fixes_test.dart
index d0e219f..a0d3b9f 100644
--- a/pkg/analysis_server/test/lsp/code_actions_fixes_test.dart
+++ b/pkg/analysis_server/test/lsp/code_actions_fixes_test.dart
@@ -34,7 +34,7 @@
 
     Future foo;
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -76,7 +76,7 @@
 
     Future foo;
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -110,7 +110,7 @@
     final expectedCreatedFile =
         path.join(path.dirname(mainFilePath), 'newfile.dart');
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -141,7 +141,7 @@
 
     Future foo;
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     ofKind(CodeActionKind kind) => getCodeActions(
@@ -166,7 +166,7 @@
 var b = bar();
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -188,7 +188,7 @@
 }
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -217,7 +217,7 @@
   print(a);
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -260,7 +260,7 @@
 import 'dart:convert';
 
 Future foo;''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -295,7 +295,7 @@
 import 'dart:convert';
 
 Future foo;''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -330,7 +330,7 @@
     }
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -358,7 +358,7 @@
     var a = [Test, Test, Te[[]]st];
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -378,7 +378,7 @@
     var a = [Test, Test, Te[[]]st];
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
         textDocumentCapabilities: withCodeActionKinds(
             emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -395,7 +395,7 @@
   }
 
   Future<void> test_nonDartFile() async {
-    newFile2(pubspecFilePath, simplePubspecContent);
+    newFile(pubspecFilePath, simplePubspecContent);
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -408,7 +408,7 @@
 
   Future<void> test_organizeImportsFix_namedOrganizeImports() async {
     registerLintRules();
-    newFile2(analysisOptionsPath, '''
+    newFile(analysisOptionsPath, '''
 linter:
   rules:
     - directives_ordering
@@ -430,7 +430,7 @@
 Completer a;
 ProcessInfo b;
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -457,7 +457,7 @@
   Future<void> test_outsideRoot() async {
     final otherFilePath = convertPath('/home/otherProject/foo.dart');
     final otherFileUri = Uri.file(otherFilePath);
-    newFile2(otherFilePath, 'bad code to create error');
+    newFile(otherFilePath, 'bad code to create error');
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -501,7 +501,7 @@
           request is plugin.EditGetFixesParams ? pluginResult : null,
     );
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -551,7 +551,7 @@
           request is plugin.EditGetFixesParams ? pluginResult : null,
     );
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -589,7 +589,7 @@
 }
 ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
@@ -637,7 +637,7 @@
 useFunction(int g(a, b)) {}
 ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
           emptyTextDocumentClientCapabilities, [CodeActionKind.QuickFix]),
diff --git a/pkg/analysis_server/test/lsp/code_actions_refactor_test.dart b/pkg/analysis_server/test/lsp/code_actions_refactor_test.dart
index d508645..6b3ab24 100644
--- a/pkg/analysis_server/test/lsp/code_actions_refactor_test.dart
+++ b/pkg/analysis_server/test/lsp/code_actions_refactor_test.dart
@@ -47,7 +47,7 @@
   var b = test();
 }
 ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -79,7 +79,7 @@
   var b = test;
 }
 ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -147,7 +147,7 @@
   print('Test!');
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -176,7 +176,7 @@
   print('Test!');
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -244,7 +244,7 @@
   [[print('Test!');]]
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
       textDocumentCapabilities: withCodeActionKinds(
         emptyTextDocumentClientCapabilities,
@@ -304,7 +304,7 @@
 Object Container(Object text) => null;
 Object Text(Object text) => null;
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -322,7 +322,7 @@
 ^
 main() {}
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString());
@@ -348,7 +348,7 @@
   print('Test!');
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
         windowCapabilities:
             withWorkDoneProgressSupport(emptyWindowClientCapabilities));
@@ -384,7 +384,7 @@
   print('Test!');
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     var didGetProgressNotifications = false;
@@ -420,7 +420,7 @@
   print('Test!');
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
         windowCapabilities:
             withWorkDoneProgressSupport(emptyWindowClientCapabilities));
@@ -448,7 +448,7 @@
 void doFoo(void Function() a) => a();
 
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -485,7 +485,7 @@
 void doFoo(void Function() a) => a();
 
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -534,7 +534,7 @@
 
 void foo(int arg) {}
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -564,7 +564,7 @@
 
 void foo(int arg) {}
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -647,7 +647,7 @@
   }
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -665,7 +665,7 @@
 ^
 main() {}
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString());
@@ -706,7 +706,7 @@
   print(1);
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -750,7 +750,7 @@
   print('test');
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
@@ -785,7 +785,7 @@
   print('test');
 }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString(),
diff --git a/pkg/analysis_server/test/lsp/code_actions_source_test.dart b/pkg/analysis_server/test/lsp/code_actions_source_test.dart
index ecdfe3a..215da02 100644
--- a/pkg/analysis_server/test/lsp/code_actions_source_test.dart
+++ b/pkg/analysis_server/test/lsp/code_actions_source_test.dart
@@ -38,8 +38,8 @@
     ''';
 
     registerLintRules();
-    newFile2(analysisOptionsPath, analysisOptionsContent);
-    newFile2(mainFilePath, content);
+    newFile(analysisOptionsPath, analysisOptionsContent);
+    newFile(mainFilePath, content);
 
     await initialize(
         workspaceCapabilities:
@@ -70,7 +70,7 @@
 Completer foo;
 int minified(int x, int y) => min(x, y);
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(
         workspaceCapabilities: withApplyEditSupport(
             withDocumentChangesSupport(emptyWorkspaceClientCapabilities)));
@@ -98,7 +98,7 @@
 Completer foo;
 int minified(int x, int y) => min(x, y);
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(
         workspaceCapabilities:
             withApplyEditSupport(emptyWorkspaceClientCapabilities));
@@ -110,7 +110,7 @@
   }
 
   Future<void> test_availableAsCodeActionLiteral() async {
-    newFile2(mainFilePath, '');
+    newFile(mainFilePath, '');
     await initialize(
         textDocumentCapabilities: withCodeActionKinds(
             emptyTextDocumentClientCapabilities, [CodeActionKind.Source]),
@@ -126,7 +126,7 @@
   }
 
   Future<void> test_availableAsCommand() async {
-    newFile2(mainFilePath, '');
+    newFile(mainFilePath, '');
     await initialize(
         workspaceCapabilities:
             withApplyEditSupport(emptyWorkspaceClientCapabilities));
@@ -141,7 +141,7 @@
 
   Future<void> test_failsSilentlyIfFileHasErrors() async {
     final content = 'invalid dart code';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(
         workspaceCapabilities:
             withApplyEditSupport(emptyWorkspaceClientCapabilities));
@@ -161,7 +161,7 @@
   }
 
   Future<void> test_filtersCorrectly() async {
-    newFile2(mainFilePath, '');
+    newFile(mainFilePath, '');
     await initialize(
         workspaceCapabilities:
             withApplyEditSupport(emptyWorkspaceClientCapabilities));
@@ -187,7 +187,7 @@
 Completer foo;
 int minified(int x, int y) => min(x, y);
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(
         workspaceCapabilities:
             withApplyEditSupport(emptyWorkspaceClientCapabilities));
@@ -208,7 +208,7 @@
   }
 
   Future<void> test_unavailableWhenNotRequested() async {
-    newFile2(mainFilePath, '');
+    newFile(mainFilePath, '');
     await initialize(
         textDocumentCapabilities: withCodeActionKinds(
             emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -221,7 +221,7 @@
   }
 
   Future<void> test_unavailableWithoutApplyEditSupport() async {
-    newFile2(mainFilePath, '');
+    newFile(mainFilePath, '');
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString());
@@ -241,7 +241,7 @@
     String a;
     String b;
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(
         workspaceCapabilities: withApplyEditSupport(
             withDocumentChangesSupport(emptyWorkspaceClientCapabilities)));
@@ -262,7 +262,7 @@
     String a;
     String b;
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(
         workspaceCapabilities:
             withApplyEditSupport(emptyWorkspaceClientCapabilities));
@@ -274,7 +274,7 @@
   }
 
   Future<void> test_availableAsCodeActionLiteral() async {
-    newFile2(mainFilePath, '');
+    newFile(mainFilePath, '');
     await initialize(
         textDocumentCapabilities: withCodeActionKinds(
             emptyTextDocumentClientCapabilities, [CodeActionKind.Source]),
@@ -290,7 +290,7 @@
   }
 
   Future<void> test_availableAsCommand() async {
-    newFile2(mainFilePath, '');
+    newFile(mainFilePath, '');
     await initialize(
         workspaceCapabilities:
             withApplyEditSupport(emptyWorkspaceClientCapabilities));
@@ -308,7 +308,7 @@
     String b;
     String a;
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(
         workspaceCapabilities:
             withApplyEditSupport(emptyWorkspaceClientCapabilities));
@@ -341,7 +341,7 @@
 
   Future<void> test_failsIfFileHasErrors() async {
     final content = 'invalid dart code';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(
         workspaceCapabilities:
             withApplyEditSupport(emptyWorkspaceClientCapabilities));
@@ -361,7 +361,7 @@
   }
 
   Future<void> test_nonDartFile() async {
-    newFile2(pubspecFilePath, simplePubspecContent);
+    newFile(pubspecFilePath, simplePubspecContent);
     await initialize(
         textDocumentCapabilities: withCodeActionKinds(
             emptyTextDocumentClientCapabilities, [CodeActionKind.Source]),
@@ -374,7 +374,7 @@
   }
 
   Future<void> test_unavailableWhenNotRequested() async {
-    newFile2(mainFilePath, '');
+    newFile(mainFilePath, '');
     await initialize(
         textDocumentCapabilities: withCodeActionKinds(
             emptyTextDocumentClientCapabilities, [CodeActionKind.Refactor]),
@@ -387,7 +387,7 @@
   }
 
   Future<void> test_unavailableWithoutApplyEditSupport() async {
-    newFile2(mainFilePath, '');
+    newFile(mainFilePath, '');
     await initialize();
 
     final codeActions = await getCodeActions(mainFileUri.toString());
diff --git a/pkg/analysis_server/test/lsp/completion_dart_test.dart b/pkg/analysis_server/test/lsp/completion_dart_test.dart
index c593f01..66574a8 100644
--- a/pkg/analysis_server/test/lsp/completion_dart_test.dart
+++ b/pkg/analysis_server/test/lsp/completion_dart_test.dart
@@ -451,7 +451,7 @@
 
   Future<void> test_completeFunctionCalls_requiredNamed_suggestionSet() async {
     final otherFile = join(projectFolderPath, 'lib', 'other.dart');
-    newFile2(
+    newFile(
       otherFile,
       "void myFunction(String a, int b, {required String c, String d = ''}) {}",
     );
@@ -540,7 +540,7 @@
       );
 
   Future<void> test_completionKinds_default() async {
-    newFile2(join(projectFolderPath, 'file.dart'), '');
+    newFile(join(projectFolderPath, 'file.dart'), '');
     newFolder(join(projectFolderPath, 'folder'));
 
     final content = "import '^';";
@@ -1053,7 +1053,7 @@
     ''';
 
     // Create a class with fields aaa1 to aaa500 in the other file.
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib', 'a.dart'),
       [
         'class A {',
@@ -1086,7 +1086,7 @@
     ''';
 
     // Create a class with fields aaa1 to aaa500 in the other file.
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib', 'a.dart'),
       [
         'class A {',
@@ -1316,7 +1316,7 @@
 
   Future<void> test_nonAnalyzedFile() async {
     final readmeFilePath = convertPath(join(projectFolderPath, 'README.md'));
-    newFile2(readmeFilePath, '');
+    newFile(readmeFilePath, '');
     await initialize();
 
     final res = await getCompletion(Uri.file(readmeFilePath), startOfDocPos);
@@ -1448,7 +1448,7 @@
   }
 
   Future<void> test_unimportedSymbols() async {
-    newFile2(
+    newFile(
       join(projectFolderPath, 'other_file.dart'),
       '''
       /// This class is in another file.
@@ -1524,19 +1524,19 @@
       test_unimportedSymbols_doesNotDuplicate_importedViaMultipleLibraries() async {
     // An item that's already imported through multiple libraries that
     // export it should not result in multiple entries.
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib/source_file.dart'),
       '''
       class MyExportedClass {}
       ''',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib/reexport1.dart'),
       '''
       export 'source_file.dart';
       ''',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib/reexport2.dart'),
       '''
       export 'source_file.dart';
@@ -1569,19 +1569,19 @@
       test_unimportedSymbols_doesNotDuplicate_importedViaSingleLibrary() async {
     // An item that's already imported through a library that exports it
     // should not result in multiple entries.
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib/source_file.dart'),
       '''
       class MyExportedClass {}
       ''',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib/reexport1.dart'),
       '''
       export 'source_file.dart';
       ''',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib/reexport2.dart'),
       '''
       export 'source_file.dart';
@@ -1611,15 +1611,15 @@
 
   Future<void> test_unimportedSymbols_doesNotFilterSymbolsWithSameName() async {
     // Classes here are not re-exports, so should not be filtered out.
-    newFile2(
+    newFile(
       join(projectFolderPath, 'source_file1.dart'),
       'class MyDuplicatedClass {}',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'source_file2.dart'),
       'class MyDuplicatedClass {}',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'source_file3.dart'),
       'class MyDuplicatedClass {}',
     );
@@ -1652,7 +1652,7 @@
   }
 
   Future<void> test_unimportedSymbols_enumValues() async {
-    newFile2(
+    newFile(
       join(projectFolderPath, 'source_file.dart'),
       '''
       enum MyExportedEnum { One, Two }
@@ -1716,19 +1716,19 @@
   }
 
   Future<void> test_unimportedSymbols_enumValuesAlreadyImported() async {
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib', 'source_file.dart'),
       '''
       enum MyExportedEnum { One, Two }
       ''',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib', 'reexport1.dart'),
       '''
       export 'source_file.dart';
       ''',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib', 'reexport2.dart'),
       '''
       export 'source_file.dart';
@@ -1760,19 +1760,19 @@
   }
 
   Future<void> test_unimportedSymbols_filtersOutAlreadyImportedSymbols() async {
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib', 'source_file.dart'),
       '''
       class MyExportedClass {}
       ''',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib', 'reexport1.dart'),
       '''
       export 'source_file.dart';
       ''',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib', 'reexport2.dart'),
       '''
       export 'source_file.dart';
@@ -1803,7 +1803,7 @@
   }
 
   Future<void> test_unimportedSymbols_importsPackageUri() async {
-    newFile2(
+    newFile(
       join(projectFolderPath, 'lib', 'my_class.dart'),
       'class MyClass {}',
     );
@@ -1834,19 +1834,19 @@
 
   Future<void>
       test_unimportedSymbols_includesReexportedSymbolsForEachFile() async {
-    newFile2(
+    newFile(
       join(projectFolderPath, 'source_file.dart'),
       '''
       class MyExportedClass {}
       ''',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'reexport1.dart'),
       '''
       export 'source_file.dart';
       ''',
     );
-    newFile2(
+    newFile(
       join(projectFolderPath, 'reexport2.dart'),
       '''
       export 'source_file.dart';
@@ -1880,7 +1880,7 @@
   }
 
   Future<void> test_unimportedSymbols_insertReplaceRanges() async {
-    newFile2(
+    newFile(
       join(projectFolderPath, 'other_file.dart'),
       '''
       /// This class is in another file.
@@ -1973,14 +1973,14 @@
 
   Future<void> test_unimportedSymbols_insertsIntoPartFiles() async {
     // File we'll be adding an import for.
-    newFile2(
+    newFile(
       join(projectFolderPath, 'other_file.dart'),
       'class InOtherFile {}',
     );
 
     // File that will have the import added.
     final parentContent = '''part 'main.dart';''';
-    final parentFilePath = newFile2(
+    final parentFilePath = newFile(
       join(projectFolderPath, 'lib', 'parent.dart'),
       parentContent,
     ).path;
@@ -2063,7 +2063,7 @@
   }
 
   Future<void> test_unimportedSymbols_members() async {
-    newFile2(
+    newFile(
       join(projectFolderPath, 'source_file.dart'),
       '''
       class MyExportedClass {
@@ -2153,7 +2153,7 @@
     await initialAnalysis;
 
     // Start with a blank file.
-    newFile2(otherFilePath, '');
+    newFile(otherFilePath, '');
     await openFile(otherFileUri, '');
     await pumpEventQueue(times: 5000);
 
@@ -2171,7 +2171,7 @@
   }
 
   Future<void> test_unimportedSymbols_namedConstructors() async {
-    newFile2(
+    newFile(
       join(projectFolderPath, 'other_file.dart'),
       '''
       /// This class is in another file.
@@ -2239,7 +2239,7 @@
         join(projectFolderPath, 'lib', 'nested2', 'imported.dart');
 
     // Create a file that will be auto-imported from completion.
-    newFile2(importedFilePath, 'class MyClass {}');
+    newFile(importedFilePath, 'class MyClass {}');
 
     final content = '''
 void f() {
@@ -2277,7 +2277,7 @@
         join(projectFolderPath, 'lib', 'nested2', 'imported.dart');
 
     // Create a file that will be auto-imported from completion.
-    newFile2(importedFilePath, 'class MyClass {}');
+    newFile(importedFilePath, 'class MyClass {}');
 
     final content = '''
 void f() {
@@ -2304,7 +2304,7 @@
   }
 
   Future<void> test_unimportedSymbols_unavailableIfDisabled() async {
-    newFile2(
+    newFile(
       join(projectFolderPath, 'other_file.dart'),
       'class InOtherFile {}',
     );
@@ -2337,7 +2337,7 @@
   Future<void> test_unimportedSymbols_unavailableWithoutApplyEdit() async {
     // If client doesn't advertise support for workspace/applyEdit, we won't
     // include suggestion sets.
-    newFile2(
+    newFile(
       join(projectFolderPath, 'other_file.dart'),
       'class InOtherFile {}',
     );
@@ -2372,7 +2372,7 @@
     }
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
     final res = await getCompletion(mainFileUri, positionFromMarker(content));
     expect(res.any((c) => c.label == 'abcdefghij'), isTrue);
@@ -2438,7 +2438,7 @@
   void _enableLints(List<String> lintNames) {
     registerLintRules();
     final lintsYaml = lintNames.map((name) => '    - $name\n').join();
-    newFile2(analysisOptionsPath, '''
+    newFile(analysisOptionsPath, '''
 linter:
   rules:
 $lintsYaml
diff --git a/pkg/analysis_server/test/lsp/completion_yaml_test.dart b/pkg/analysis_server/test/lsp/completion_yaml_test.dart
index c1b0e04..cee886f 100644
--- a/pkg/analysis_server/test/lsp/completion_yaml_test.dart
+++ b/pkg/analysis_server/test/lsp/completion_yaml_test.dart
@@ -502,7 +502,7 @@
 dependencies:
   one: ^2.3.4''';
 
-    newFile2(pubspecFilePath, content);
+    newFile(pubspecFilePath, content);
     await initialize();
     await openFile(pubspecFileUri, withoutMarkers(content));
     await pumpEventQueue(times: 500);
@@ -556,7 +556,7 @@
 dependencies:
   one: ^''';
 
-    newFile2(pubspecFilePath, content);
+    newFile(pubspecFilePath, content);
     await initialize();
     await openFile(pubspecFileUri, withoutMarkers(content));
     await pumpEventQueue(times: 500);
diff --git a/pkg/analysis_server/test/lsp/definition_test.dart b/pkg/analysis_server/test/lsp/definition_test.dart
index c8762403..33fd27d 100644
--- a/pkg/analysis_server/test/lsp/definition_test.dart
+++ b/pkg/analysis_server/test/lsp/definition_test.dart
@@ -115,7 +115,7 @@
     );
     configureTestPlugin(respondWith: pluginResult);
 
-    newFile2(pluginAnalyzedFilePath, '');
+    newFile(pluginAnalyzedFilePath, '');
     await initialize();
     final res = await getDefinitionAsLocation(
         pluginAnalyzedFileUri, lsp.Position(line: 0, character: 0));
@@ -227,7 +227,7 @@
   }
 
   Future<void> test_nonDartFile() async {
-    newFile2(pubspecFilePath, simplePubspecContent);
+    newFile(pubspecFilePath, simplePubspecContent);
     await initialize();
 
     final res = await getDefinitionAsLocation(pubspecFileUri, startOfDocPos);
@@ -311,7 +311,7 @@
 }
 ''';
 
-    newFile2(mainFilePath, withoutMarkers(contents));
+    newFile(mainFilePath, withoutMarkers(contents));
     await testContents(contents, inOpenFile: false);
   }
 
diff --git a/pkg/analysis_server/test/lsp/diagnostic_test.dart b/pkg/analysis_server/test/lsp/diagnostic_test.dart
index e93fe89d..c5024cb 100644
--- a/pkg/analysis_server/test/lsp/diagnostic_test.dart
+++ b/pkg/analysis_server/test/lsp/diagnostic_test.dart
@@ -21,7 +21,7 @@
   Future<void> checkPluginErrorsForFile(String pluginAnalyzedFilePath) async {
     final pluginAnalyzedUri = Uri.file(pluginAnalyzedFilePath);
 
-    newFile2(pluginAnalyzedFilePath, '''String a = "Test";
+    newFile(pluginAnalyzedFilePath, '''String a = "Test";
 String b = "Test";
 ''');
     await initialize();
@@ -68,7 +68,7 @@
 
   Future<void> test_afterDocumentEdits() async {
     const initialContents = 'int a = 1;';
-    newFile2(mainFilePath, initialContents);
+    newFile(mainFilePath, initialContents);
 
     final firstDiagnosticsUpdate = waitForDiagnostics(mainFileUri);
     await initialize();
@@ -84,7 +84,7 @@
   }
 
   Future<void> test_analysisOptionsFile() async {
-    newFile2(analysisOptionsPath, '''
+    newFile(analysisOptionsPath, '''
 linter:
   rules:
     - invalid_lint_rule_name
@@ -100,7 +100,7 @@
 
   @FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/43926')
   Future<void> test_analysisOptionsFile_packageInclude() async {
-    newFile2(analysisOptionsPath, '''
+    newFile(analysisOptionsPath, '''
 include: package:pedantic/analysis_options.yaml
 ''');
 
@@ -125,7 +125,7 @@
   }
 
   Future<void> test_contextMessage() async {
-    newFile2(mainFilePath, '''
+    newFile(mainFilePath, '''
 void f() {
   x = 0;
   int? x;
@@ -142,7 +142,7 @@
   }
 
   Future<void> test_correction() async {
-    newFile2(mainFilePath, '''
+    newFile(mainFilePath, '''
 void f() {
   x = 0;
 }
@@ -157,7 +157,7 @@
   }
 
   Future<void> test_deletedFile() async {
-    newFile2(mainFilePath, 'String a = 1;');
+    newFile(mainFilePath, 'String a = 1;');
 
     final firstDiagnosticsUpdate = waitForDiagnostics(mainFileUri);
     await initialize();
@@ -172,7 +172,7 @@
   }
 
   Future<void> test_diagnosticTag_deprecated() async {
-    newFile2(mainFilePath, '''
+    newFile(mainFilePath, '''
     @deprecated
     int? dep;
 
@@ -191,7 +191,7 @@
   }
 
   Future<void> test_diagnosticTag_notSupported() async {
-    newFile2(mainFilePath, '''
+    newFile(mainFilePath, '''
     @deprecated
     int? dep;
 
@@ -208,7 +208,7 @@
   }
 
   Future<void> test_diagnosticTag_unnecessary() async {
-    newFile2(mainFilePath, '''
+    newFile(mainFilePath, '''
     void main() {
       return;
       print('unreachable');
@@ -227,7 +227,7 @@
   }
 
   Future<void> test_documentationUrl() async {
-    newFile2(mainFilePath, '''
+    newFile(mainFilePath, '''
     // ignore: unused_import
     import 'dart:async' as import; // produces BUILT_IN_IDENTIFIER_IN_DECLARATION
     ''');
@@ -247,7 +247,7 @@
   }
 
   Future<void> test_documentationUrl_notSupported() async {
-    newFile2(mainFilePath, '''
+    newFile(mainFilePath, '''
     // ignore: unused_import
     import 'dart:async' as import; // produces BUILT_IN_IDENTIFIER_IN_DECLARATION
     ''');
@@ -266,7 +266,7 @@
         join(projectFolderPath, '.dart_tool', 'tool_file.dart');
     var dotFolderFileUri = Uri.file(dotFolderFilePath);
 
-    newFile2(dotFolderFilePath, 'String a = 1;');
+    newFile(dotFolderFilePath, 'String a = 1;');
 
     List<Diagnostic>? diagnostics;
     waitForDiagnostics(dotFolderFileUri).then((d) => diagnostics = d);
@@ -283,7 +283,7 @@
   Future<void> test_fixDataFile() async {
     var fixDataPath = join(projectFolderPath, 'lib', 'fix_data.yaml');
     var fixDataUri = Uri.file(fixDataPath);
-    newFile2(fixDataPath, '''
+    newFile(fixDataPath, '''
 version: latest
 ''').path;
 
@@ -309,7 +309,7 @@
         "A value of type 'int' can't be assigned to a variable of type 'String'";
     final pluginErrorMessage = 'Test error from plugin';
 
-    newFile2(mainFilePath, 'String a = 1;');
+    newFile(mainFilePath, 'String a = 1;');
     final initialDiagnosticsFuture = waitForDiagnostics(mainFileUri);
     await initialize();
     final initialDiagnostics = await initialDiagnosticsFuture;
@@ -342,7 +342,7 @@
   }
 
   Future<void> test_initialAnalysis() async {
-    newFile2(mainFilePath, 'String a = 1;');
+    newFile(mainFilePath, 'String a = 1;');
 
     final diagnosticsUpdate = waitForDiagnostics(mainFileUri);
     await initialize();
@@ -385,7 +385,7 @@
     // FIXME: This
     String a = "";
     ''';
-    newFile2(mainFilePath, contents);
+    newFile(mainFilePath, contents);
 
     final firstDiagnosticsUpdate = waitForDiagnostics(mainFileUri);
     await provideConfig(
@@ -403,7 +403,7 @@
     // TODO: This
     String a = "";
     ''';
-    newFile2(mainFilePath, contents);
+    newFile(mainFilePath, contents);
 
     final firstDiagnosticsUpdate = waitForDiagnostics(mainFileUri);
     // TODOs are disabled by default so we don't need to send any config.
@@ -449,7 +449,7 @@
     // FIXME: This
     String a = "";
     ''';
-    newFile2(mainFilePath, contents);
+    newFile(mainFilePath, contents);
 
     final firstDiagnosticsUpdate = waitForDiagnostics(mainFileUri);
     await provideConfig(
diff --git a/pkg/analysis_server/test/lsp/document_color_test.dart b/pkg/analysis_server/test/lsp/document_color_test.dart
index ff131a3..2bb92a0 100644
--- a/pkg/analysis_server/test/lsp/document_color_test.dart
+++ b/pkg/analysis_server/test/lsp/document_color_test.dart
@@ -40,7 +40,7 @@
     importRange = ranges[0];
     colorRange = ranges[1];
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final colorPresentations = await getColorPresentation(
@@ -60,7 +60,7 @@
   }
 
   Future<void> test_nonDartFile() async {
-    newFile2(pubspecFilePath, simplePubspecContent);
+    newFile(pubspecFilePath, simplePubspecContent);
     await initialize();
 
     final colors = await getColorPresentation(
@@ -80,7 +80,7 @@
     colorRange = rangeFromMarkers(content);
 
     final outsideRootFilePath = convertPath('/home/other/test.dart');
-    newFile2(outsideRootFilePath, withoutMarkers(content));
+    newFile(outsideRootFilePath, withoutMarkers(content));
     await initialize();
 
     final colorPresentations = await getColorPresentation(
@@ -102,7 +102,7 @@
     ''';
     colorRange = rangeFromMarkers(content);
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final colorPresentations = await getColorPresentation(
@@ -155,7 +155,7 @@
   }
 
   Future<void> test_nonDartFile() async {
-    newFile2(pubspecFilePath, simplePubspecContent);
+    newFile(pubspecFilePath, simplePubspecContent);
     await initialize();
 
     final colors = await getDocumentColors(pubspecFileUri.toString());
@@ -168,7 +168,7 @@
 
     const red = [[Colors.red]];
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final colors = await getDocumentColors(mainFileUri.toString());
diff --git a/pkg/analysis_server/test/lsp/document_symbols_test.dart b/pkg/analysis_server/test/lsp/document_symbols_test.dart
index c49bf01..2fb6196 100644
--- a/pkg/analysis_server/test/lsp/document_symbols_test.dart
+++ b/pkg/analysis_server/test/lsp/document_symbols_test.dart
@@ -24,7 +24,7 @@
       light,
     }
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize();
 
     final result = await getDocumentSymbols(mainFileUri.toString());
@@ -53,7 +53,7 @@
       light,
     }
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(
       textDocumentCapabilities: withDocumentSymbolKinds(
         emptyTextDocumentClientCapabilities,
@@ -90,7 +90,7 @@
     extension StringExtensions on String {}
     extension on String {}
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize();
 
     final result = await getDocumentSymbols(mainFileUri.toString());
@@ -143,7 +143,7 @@
       myMethod() {}
     }
     ''';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(
         textDocumentCapabilities: withHierarchicalDocumentSymbolSupport(
             emptyTextDocumentClientCapabilities));
@@ -182,7 +182,7 @@
     // When there are no analysis roots and we open a file, it should be added as
     // a temporary root allowing us to service requests for it.
     const content = 'class MyClass {}';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(allowEmptyRootUri: true);
     await openFile(mainFileUri, content);
 
@@ -203,7 +203,7 @@
     // When there are no analysis roots and we receive requests for a file that
     // was not opened, we will reject the file due to not being analyzed.
     const content = 'class MyClass {}';
-    newFile2(mainFilePath, content);
+    newFile(mainFilePath, content);
     await initialize(allowEmptyRootUri: true);
 
     await expectLater(
@@ -213,7 +213,7 @@
   }
 
   Future<void> test_nonDartFile() async {
-    newFile2(pubspecFilePath, simplePubspecContent);
+    newFile(pubspecFilePath, simplePubspecContent);
     await initialize();
 
     final result = await getDocumentSymbols(pubspecFileUri.toString());
diff --git a/pkg/analysis_server/test/lsp/folding_test.dart b/pkg/analysis_server/test/lsp/folding_test.dart
index 2aa3b7c..e984e02 100644
--- a/pkg/analysis_server/test/lsp/folding_test.dart
+++ b/pkg/analysis_server/test/lsp/folding_test.dart
@@ -143,7 +143,7 @@
     ''';
     final ranges = rangesFromMarkers(content);
     final withoutMarkers = withoutRangeMarkers(content);
-    newFile2(pluginAnalyzedFilePath, '');
+    newFile(pluginAnalyzedFilePath, '');
 
     await initialize();
     await openFile(pluginAnalyzedUri, withoutMarkers);
@@ -173,7 +173,7 @@
       );
     ''';
     final withoutMarkers = withoutRangeMarkers(content);
-    newFile2(pluginAnalyzedFilePath, withoutMarkers);
+    newFile(pluginAnalyzedFilePath, withoutMarkers);
 
     await initialize();
     await openFile(pluginAnalyzedUri, withoutMarkers);
diff --git a/pkg/analysis_server/test/lsp/format_test.dart b/pkg/analysis_server/test/lsp/format_test.dart
index ad72337..2683483 100644
--- a/pkg/analysis_server/test/lsp/format_test.dart
+++ b/pkg/analysis_server/test/lsp/format_test.dart
@@ -695,7 +695,7 @@
   print('test');
 }
 ''';
-    newFile2(mainFilePath, contents);
+    newFile(mainFilePath, contents);
     await initialize();
     await expectFormattedContents(mainFileUri, contents, expected);
   }
diff --git a/pkg/analysis_server/test/lsp/hover_test.dart b/pkg/analysis_server/test/lsp/hover_test.dart
index 967e185..f76a5aa 100644
--- a/pkg/analysis_server/test/lsp/hover_test.dart
+++ b/pkg/analysis_server/test/lsp/hover_test.dart
@@ -338,7 +338,7 @@
     String [[a^bc]];
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
     final hover = await getHover(mainFileUri, positionFromMarker(content));
     expect(hover, isNotNull);
diff --git a/pkg/analysis_server/test/lsp/implementation_test.dart b/pkg/analysis_server/test/lsp/implementation_test.dart
index ab2593d..488c4b9 100644
--- a/pkg/analysis_server/test/lsp/implementation_test.dart
+++ b/pkg/analysis_server/test/lsp/implementation_test.dart
@@ -151,7 +151,7 @@
     ''');
 
   Future<void> test_nonDartFile() async {
-    newFile2(pubspecFilePath, simplePubspecContent);
+    newFile(pubspecFilePath, simplePubspecContent);
     await initialize();
 
     final res = await getImplementations(pubspecFileUri, startOfDocPos);
diff --git a/pkg/analysis_server/test/lsp/initialization_test.dart b/pkg/analysis_server/test/lsp/initialization_test.dart
index 3949a70..a05138c 100644
--- a/pkg/analysis_server/test/lsp/initialization_test.dart
+++ b/pkg/analysis_server/test/lsp/initialization_test.dart
@@ -33,15 +33,15 @@
   Future<void> test_bazelWorkspace() async {
     var workspacePath = '/home/user/ws';
     // Make it a Bazel workspace.
-    newFile2(convertPath('$workspacePath/WORKSPACE'), '');
+    newFile(convertPath('$workspacePath/WORKSPACE'), '');
 
     var packagePath = '$workspacePath/team/project1';
 
     // Make it a Blaze project.
-    newFile2(convertPath('$packagePath/BUILD'), '');
+    newFile(convertPath('$packagePath/BUILD'), '');
 
     final file1 = convertPath('$packagePath/lib/file1.dart');
-    newFile2(file1, '');
+    newFile(file1, '');
 
     await initialize(allowEmptyRootUri: true);
 
@@ -498,10 +498,10 @@
   Future<void> test_emptyAnalysisRoots_multipleOpenFiles() async {
     final file1 = join(projectFolderPath, 'file1.dart');
     final file1Uri = Uri.file(file1);
-    newFile2(file1, '');
+    newFile(file1, '');
     final file2 = join(projectFolderPath, 'file2.dart');
     final file2Uri = Uri.file(file2);
-    newFile2(file2, '');
+    newFile(file2, '');
     newPubspecYamlFile(projectFolderPath, '');
 
     await initialize(allowEmptyRootUri: true);
@@ -532,7 +532,7 @@
     final nestedFilePath = join(
         projectFolderPath, 'nested', 'deeply', 'in', 'folders', 'test.dart');
     final nestedFileUri = Uri.file(nestedFilePath);
-    newFile2(nestedFilePath, '');
+    newFile(nestedFilePath, '');
 
     // The project folder shouldn't be added to start with.
     await initialize(allowEmptyRootUri: true);
@@ -547,7 +547,7 @@
     final nestedFilePath = join(
         projectFolderPath, 'nested', 'deeply', 'in', 'folders', 'test.dart');
     final nestedFileUri = Uri.file(nestedFilePath);
-    newFile2(nestedFilePath, '');
+    newFile(nestedFilePath, '');
     newPubspecYamlFile(projectFolderPath, '');
 
     // The project folder shouldn't be added to start with.
@@ -736,7 +736,7 @@
 
   Future<void> test_nonProjectFiles_basicWorkspace() async {
     final file1 = convertPath('/home/nonProject/file1.dart');
-    newFile2(file1, '');
+    newFile(file1, '');
 
     await initialize(allowEmptyRootUri: true);
 
@@ -747,10 +747,10 @@
 
   Future<void> test_nonProjectFiles_bazelWorkspace() async {
     final file1 = convertPath('/home/nonProject/file1.dart');
-    newFile2(file1, '');
+    newFile(file1, '');
 
     // Make /home a bazel workspace.
-    newFile2(convertPath('/home/WORKSPACE'), '');
+    newFile(convertPath('/home/WORKSPACE'), '');
 
     await initialize(allowEmptyRootUri: true);
 
@@ -781,10 +781,10 @@
   Future<void> test_onlyAnalyzeProjectsWithOpenFiles_multipleFiles() async {
     final file1 = join(projectFolderPath, 'file1.dart');
     final file1Uri = Uri.file(file1);
-    newFile2(file1, '');
+    newFile(file1, '');
     final file2 = join(projectFolderPath, 'file2.dart');
     final file2Uri = Uri.file(file2);
-    newFile2(file2, '');
+    newFile(file2, '');
     newPubspecYamlFile(projectFolderPath, '');
 
     await initialize(
@@ -819,7 +819,7 @@
     final nestedFilePath = join(
         projectFolderPath, 'nested', 'deeply', 'in', 'folders', 'test.dart');
     final nestedFileUri = Uri.file(nestedFilePath);
-    newFile2(nestedFilePath, '');
+    newFile(nestedFilePath, '');
 
     // The project folder shouldn't be added to start with.
     await initialize(
@@ -837,7 +837,7 @@
     final nestedFilePath = join(
         projectFolderPath, 'nested', 'deeply', 'in', 'folders', 'test.dart');
     final nestedFileUri = Uri.file(nestedFilePath);
-    newFile2(nestedFilePath, '');
+    newFile(nestedFilePath, '');
     newPubspecYamlFile(projectFolderPath, '');
 
     // The project folder shouldn't be added to start with.
diff --git a/pkg/analysis_server/test/lsp/reanalyze_test.dart b/pkg/analysis_server/test/lsp/reanalyze_test.dart
index 0c3e3d5..ca2de91 100644
--- a/pkg/analysis_server/test/lsp/reanalyze_test.dart
+++ b/pkg/analysis_server/test/lsp/reanalyze_test.dart
@@ -17,7 +17,7 @@
 class ReanalyzeTest extends AbstractLspAnalysisServerTest {
   Future<void> test_reanalyze() async {
     const initialContents = 'int a = 1;';
-    newFile2(mainFilePath, initialContents);
+    newFile(mainFilePath, initialContents);
 
     final initialAnalysis = waitForAnalysisComplete();
 
diff --git a/pkg/analysis_server/test/lsp/references_test.dart b/pkg/analysis_server/test/lsp/references_test.dart
index df007e5..a87b1db 100644
--- a/pkg/analysis_server/test/lsp/references_test.dart
+++ b/pkg/analysis_server/test/lsp/references_test.dart
@@ -102,7 +102,7 @@
   }
 
   Future<void> test_nonDartFile() async {
-    newFile2(pubspecFilePath, simplePubspecContent);
+    newFile(pubspecFilePath, simplePubspecContent);
     await initialize();
 
     final res = await getReferences(pubspecFileUri, startOfDocPos);
@@ -137,7 +137,7 @@
     }
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(contents));
+    newFile(mainFilePath, withoutMarkers(contents));
     await initialize();
     final res = await getReferences(mainFileUri, positionFromMarker(contents));
 
diff --git a/pkg/analysis_server/test/lsp/rename_test.dart b/pkg/analysis_server/test/lsp/rename_test.dart
index ddb3df6..b032485 100644
--- a/pkg/analysis_server/test/lsp/rename_test.dart
+++ b/pkg/analysis_server/test/lsp/rename_test.dart
@@ -244,7 +244,7 @@
     ''';
     final otherFilePath = join(projectFolderPath, 'lib', 'other.dart');
     final newMainFilePath = join(projectFolderPath, 'lib', 'my_new_main.dart');
-    newFile2(mainFilePath, withoutMarkers(mainContent));
+    newFile(mainFilePath, withoutMarkers(mainContent));
     await pumpEventQueue(times: 5000);
     await provideConfig(
       () async {
@@ -539,7 +539,7 @@
     final a = new [[Ob^ject]]();
     ''';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final request = makeRequest(
diff --git a/pkg/analysis_server/test/lsp/server_abstract.dart b/pkg/analysis_server/test/lsp/server_abstract.dart
index bb5e2d7..4277d90 100644
--- a/pkg/analysis_server/test/lsp/server_abstract.dart
+++ b/pkg/analysis_server/test/lsp/server_abstract.dart
@@ -210,7 +210,7 @@
     newFolder(join(projectFolderPath, 'lib'));
     // Create a folder and file to aid testing that includes imports/completion.
     newFolder(join(projectFolderPath, 'lib', 'folder'));
-    newFile2(join(projectFolderPath, 'lib', 'file.dart'), '');
+    newFile(join(projectFolderPath, 'lib', 'file.dart'), '');
     mainFilePath = join(projectFolderPath, 'lib', 'main.dart');
     mainFileUri = Uri.file(mainFilePath);
     pubspecFilePath = join(projectFolderPath, file_paths.pubspecYaml);
@@ -612,7 +612,7 @@
 
     var path = '$projectFolderPath/.dart_tool/package_config.json';
     var content = config.toContent(toUriStr: toUriStr);
-    newFile2(path, content);
+    newFile(path, content);
   }
 }
 
diff --git a/pkg/analysis_server/test/lsp/signature_help_test.dart b/pkg/analysis_server/test/lsp/signature_help_test.dart
index 9a59150..d5add03 100644
--- a/pkg/analysis_server/test/lsp/signature_help_test.dart
+++ b/pkg/analysis_server/test/lsp/signature_help_test.dart
@@ -609,7 +609,7 @@
     final expectedLabel = 'foo(String s, int i)';
     final expectedDoc = 'Does foo.';
 
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize(
         textDocumentCapabilities: withSignatureHelpContentFormat(
             emptyTextDocumentClientCapabilities, [MarkupKind.Markdown]));
diff --git a/pkg/analysis_server/test/lsp/type_definition_test.dart b/pkg/analysis_server/test/lsp/type_definition_test.dart
index b7c92ea..c2ad165 100644
--- a/pkg/analysis_server/test/lsp/type_definition_test.dart
+++ b/pkg/analysis_server/test/lsp/type_definition_test.dart
@@ -92,7 +92,7 @@
 const a = '^';
 ''';
 
-    newFile2(pubspecFilePath, withoutMarkers(contents));
+    newFile(pubspecFilePath, withoutMarkers(contents));
     await initialize();
     final results = await getTypeDefinitionAsLocation(
         mainFileUri, positionFromMarker(contents));
@@ -112,7 +112,7 @@
 class [[A]] {}
 ''';
 
-    newFile2(otherFilePath, withoutMarkers(otherContents));
+    newFile(otherFilePath, withoutMarkers(otherContents));
     final result = await _getResult(contents);
     expect(result.originSelectionRange, rangeFromMarkers(contents));
     expect(result.targetUri, otherFileUri.toString());
@@ -186,7 +186,7 @@
 const a = [['^']];
 ''';
 
-    newFile2(mainFilePath, withoutMarkers(contents));
+    newFile(mainFilePath, withoutMarkers(contents));
     final result = await _getResult(contents, inOpenFile: false);
     expect(result.originSelectionRange, rangeFromMarkers(contents));
     _expectSdkCoreType(result, 'String');
diff --git a/pkg/analysis_server/test/lsp/workspace_symbols_test.dart b/pkg/analysis_server/test/lsp/workspace_symbols_test.dart
index 1806765..c617811 100644
--- a/pkg/analysis_server/test/lsp/workspace_symbols_test.dart
+++ b/pkg/analysis_server/test/lsp/workspace_symbols_test.dart
@@ -22,7 +22,7 @@
     const content = '''
     void f() {}
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final symbolsRequest1 = makeRequest(
@@ -62,7 +62,7 @@
     extension StringExtensions on String {}
     extension on String {}
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final symbols = await getWorkspaceSymbols('S');
@@ -84,7 +84,7 @@
       myMethod() {}
     }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final symbols = await getWorkspaceSymbols('topLevel');
@@ -109,7 +109,7 @@
       myMethod() {}
     }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     // meld should match myField
@@ -158,7 +158,7 @@
       [[myMethodWithArgs(int a) {}]]
     }
     ''';
-    newFile2(mainFilePath, withoutMarkers(content));
+    newFile(mainFilePath, withoutMarkers(content));
     await initialize();
 
     final symbols = await getWorkspaceSymbols('my');
diff --git a/pkg/analysis_server/test/search/declarations_test.dart b/pkg/analysis_server/test/search/declarations_test.dart
index 1fc44a1..faf5df9 100644
--- a/pkg/analysis_server/test/search/declarations_test.dart
+++ b/pkg/analysis_server/test/search/declarations_test.dart
@@ -83,11 +83,11 @@
   }
 
   Future<void> test_maxResults() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 class B {}
 ''').path;
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 class C {}
 class D {}
 ''').path;
@@ -124,8 +124,8 @@
   }
 
   Future<void> test_multipleFiles() async {
-    var a = newFile2('$testPackageLibPath/a.dart', 'class A {}').path;
-    var b = newFile2('$testPackageLibPath/b.dart', 'class B {}').path;
+    var a = newFile('$testPackageLibPath/a.dart', 'class A {}').path;
+    var b = newFile('$testPackageLibPath/b.dart', 'class B {}').path;
 
     await _getDeclarations();
 
@@ -153,8 +153,8 @@
   }
 
   Future<void> test_onlyForFile() async {
-    var a = newFile2('$testPackageLibPath/a.dart', 'class A {}').path;
-    newFile2('$testPackageLibPath/b.dart', 'class B {}').path;
+    var a = newFile('$testPackageLibPath/a.dart', 'class A {}').path;
+    newFile('$testPackageLibPath/b.dart', 'class B {}').path;
 
     await _getDeclarations(file: a);
 
diff --git a/pkg/analysis_server/test/search/type_hierarchy_test.dart b/pkg/analysis_server/test/search/type_hierarchy_test.dart
index 296fb20..10f7652 100644
--- a/pkg/analysis_server/test/search/type_hierarchy_test.dart
+++ b/pkg/analysis_server/test/search/type_hierarchy_test.dart
@@ -158,7 +158,7 @@
 
   Future<void> test_class_extends_fileAndPackageUris() async {
     // prepare packages
-    newFile2('$packagesRootPath/pkgA/lib/libA.dart', '''
+    newFile('$packagesRootPath/pkgA/lib/libA.dart', '''
 library lib_a;
 class A {}
 class B extends A {}
@@ -648,7 +648,7 @@
   }
 
   Future<void> test_class_member_method_private_differentLib() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 import 'test.dart';
 class A {
   void _m() {}
diff --git a/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
index 66791e5..ed5279a 100644
--- a/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/arglist_contributor_test.dart
@@ -732,7 +732,7 @@
     await computeAndCheck();
 
     // Annotation, imported class.
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   const A$parameters;
 }
@@ -746,7 +746,7 @@
     await computeAndCheck();
 
     // Annotation, imported class, prefixed.
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   const A$parameters;
 }
@@ -789,7 +789,7 @@
     await computeAndCheck();
 
     // Instance creation, imported class, generative.
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   A$parameters;
 }
@@ -802,7 +802,7 @@
     await computeAndCheck();
 
     // Instance creation, imported class, factory.
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   factory A$parameters => throw 0;
 }
@@ -833,7 +833,7 @@
     await computeAndCheck();
 
     // Method invocation, imported function.
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 void f$parameters() {}
 ''');
     addTestSource2('''
diff --git a/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart b/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart
index 555a28f..13a48fe 100644
--- a/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/completion_manager_test.dart
@@ -32,7 +32,7 @@
   }
 
   Future<void> test_resolveDirectives() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 library libA;
 /// My class.
 /// Short description.
@@ -40,7 +40,7 @@
 /// Longer description.
 class A {}
 ''');
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 library libB;
 import "a.dart" as foo;
 part 'test.dart';
diff --git a/pkg/analysis_server/test/services/completion/dart/declaration/enum_test.dart b/pkg/analysis_server/test/services/completion/dart/declaration/enum_test.dart
index e06f764..cb88047 100644
--- a/pkg/analysis_server/test/services/completion/dart/declaration/enum_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/declaration/enum_test.dart
@@ -59,7 +59,7 @@
   }
 
   Future<void> test_enumConstantName_imported_withPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 enum MyEnum { foo01 }
 ''');
 
@@ -119,7 +119,7 @@
   }
 
   Future<void> test_enumName_imported_withPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 enum MyEnum { foo01 }
 ''');
 
@@ -155,7 +155,7 @@
 
   @FailingTest(reason: 'element.kind is LIBRARY')
   Future<void> test_importPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 enum MyEnum { v }
 ''');
 
@@ -189,7 +189,7 @@
   }
 
   Future<void> test_importPrefix_dot() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 enum MyEnum { v }
 ''');
 
@@ -246,7 +246,7 @@
   }
 
   Future<void> test_nothing_imported_withPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 enum MyEnum { v }
 ''');
 
@@ -304,7 +304,7 @@
 
     // imported
     {
-      newFile2('$testPackageLibPath/a.dart', '''
+      newFile('$testPackageLibPath/a.dart', '''
 $declaration
 ''');
       if (isProtocolVersion1) {
@@ -321,7 +321,7 @@
 
     // not imported
     {
-      newFile2('$testPackageLibPath/a.dart', '''
+      newFile('$testPackageLibPath/a.dart', '''
 $declaration
 ''');
       if (isProtocolVersion1) {
diff --git a/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
index 4305c13..3b05dc9 100644
--- a/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/imported_reference_contributor_test.dart
@@ -1237,7 +1237,7 @@
   }
 
   Future<void> test_Block_unimported() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
 
     addTestSource('void f() { ^ }');
 
@@ -1971,7 +1971,7 @@
   }
 
   Future<void> test_ExtendsClause() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
     addTestSource('''
 import 'a.dart';
 
@@ -1982,7 +1982,7 @@
   }
 
   Future<void> test_ExtensionDeclaration_extendedType() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
     addTestSource('''
 import 'a.dart';
 
@@ -1994,7 +1994,7 @@
   }
 
   Future<void> test_ExtensionDeclaration_extendedType2() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
     addTestSource('''
 import 'a.dart';
 
@@ -2006,7 +2006,7 @@
   }
 
   Future<void> test_ExtensionDeclaration_member() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
     addTestSource('''
 import 'a.dart';
 
@@ -2697,7 +2697,7 @@
   }
 
   Future<void> test_implementsClause() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
     addTestSource('''
 import 'a.dart';
 
@@ -4898,7 +4898,7 @@
   }
 
   Future<void> test_withClause_mixin() async {
-    newFile2('$testPackageLibPath/a.dart', 'mixin M {}');
+    newFile('$testPackageLibPath/a.dart', 'mixin M {}');
     addTestSource('''
 import 'a.dart';
 
diff --git a/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
index 5f1ccc7..83bd6c0 100644
--- a/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/library_member_contributor_test.dart
@@ -104,7 +104,7 @@
 
   Future<void> test_libraryPrefix_deferred_inPart() async {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
         library testA;
         import "dart:async" deferred as bar;
         part "test.dart";''');
@@ -118,8 +118,8 @@
   }
 
   Future<void> test_libraryPrefix_with_exports() async {
-    newFile2('$testPackageLibPath/a.dart', 'library libA; class A { }');
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/a.dart', 'library libA; class A { }');
+    newFile('$testPackageLibPath/b.dart', '''
         library libB;
         export "a.dart";
         class B { }
@@ -194,12 +194,12 @@
 
   Future<void> test_PrefixedIdentifier_library_inPart() async {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
         lib B;
         var T1;
         class X { }
         class Y { }''');
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
         library testA;
         import "b.dart" as b;
         part "test.dart";
@@ -225,7 +225,7 @@
 
   Future<void> test_PrefixedIdentifier_library_typesOnly() async {
     // SimpleIdentifier  PrefixedIdentifier  NamedType
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
         lib B;
         var T1;
         class X { }
@@ -258,7 +258,7 @@
 
   Future<void> test_PrefixedIdentifier_library_typesOnly2() async {
     // SimpleIdentifier  PrefixedIdentifier  NamedType
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
         lib B;
         var T1;
         class X { }
@@ -283,7 +283,7 @@
 
   Future<void> test_PrefixedIdentifier_parameter() async {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
         lib B;
         class _W {M y; var _z;}
         class X extends _W {}
@@ -297,7 +297,7 @@
 
   Future<void> test_PrefixedIdentifier_prefix() async {
     // SimpleIdentifier  PrefixedIdentifier  ExpressionStatement
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
         class A {static int bar = 10;}
         _B() {}''');
     addTestSource('''
diff --git a/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
index 5c1dd55..55e4757 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_library_contributor_test.dart
@@ -29,12 +29,12 @@
 
   Future<void> test_partFile_Constructor() async {
     // SimpleIdentifier  NamedType  ConstructorName
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
         lib B;
         int T1;
         F1() { }
         class X {X.c(); X._d(); z() {}}''');
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
         library libA;
         import "b.dart";
         part "test.dart";
@@ -64,12 +64,12 @@
 
   Future<void> test_partFile_Constructor2() async {
     // SimpleIdentifier  NamedType  ConstructorName
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
         lib B;
         int T1;
         F1() { }
         class X {X.c(); X._d(); z() {}}''');
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
         part of libA;
         class B { }''');
     addTestSource('''
@@ -97,7 +97,7 @@
   }
 
   Future<void> test_partFile_extension() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 part of libA;
 extension E on int {}
 ''');
@@ -115,12 +115,12 @@
   Future<void>
       test_partFile_InstanceCreationExpression_assignment_filter() async {
     // ConstructorName  InstanceCreationExpression  VariableDeclarationList
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
         lib B;
         int T1;
         F1() { }
         class X {X.c(); X._d(); z() {}}''');
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
         part of libA;
         class A {} class B extends A {} class C implements A {} class D {}
         ''');
@@ -162,12 +162,12 @@
   Future<void>
       test_partFile_InstanceCreationExpression_variable_declaration_filter() async {
     // ConstructorName  InstanceCreationExpression  VariableDeclarationList
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
         lib B;
         int T1;
         F1() { }
         class X {X.c(); X._d(); z() {}}''');
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
         part of libA;
         class A {} class B extends A {} class C implements A {} class D {}
         ''');
@@ -205,12 +205,12 @@
   }
 
   Future<void> test_partFile_TypeName() async {
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
         lib B;
         int T1;
         F1() { }
         class X {X.c(); X._d(); z() {}}''');
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
         library libA;
         import "b.dart";
         part "test.dart";
@@ -254,12 +254,12 @@
   }
 
   Future<void> test_partFile_TypeName2() async {
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
         lib B;
         int T1;
         F1() { }
         class X {X.c(); X._d(); z() {}}''');
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
         part of libA;
         class B { var b1; b2(){}}
         int bf() => 0;
diff --git a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
index 45e5c5d..d8a3ff4 100644
--- a/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/local_reference_contributor_test.dart
@@ -1512,7 +1512,7 @@
   }
 
   Future<void> test_Block_unimported() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
     addTestSource('void f() { ^ }');
 
     await computeSuggestions();
diff --git a/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart
index 01f664e..1b0ab51 100644
--- a/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/override_contributor_test.dart
@@ -462,7 +462,7 @@
   }
 
   Future<void> test_private_otherLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   void foo() {}
   void _bar() {}
diff --git a/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart
index ea54cb1..95dc417 100644
--- a/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/type_member_contributor_test.dart
@@ -1079,7 +1079,7 @@
   }
 
   Future<void> test_Block_unimported() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
     addTestSource('void f() { ^ }');
 
     await computeSuggestions();
diff --git a/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart b/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart
index e2d0297..d9d029d 100644
--- a/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart
+++ b/pkg/analysis_server/test/services/completion/dart/uri_contributor_test.dart
@@ -75,9 +75,9 @@
   Future<void> test_export_package2() async {
     var fooRootPath = '$workspaceRootPath/foo';
     var barRootPath = '$workspaceRootPath/bar';
-    newFile2('$fooRootPath/lib/foo.dart', 'library foo;');
-    newFile2('$fooRootPath/lib/baz/too.dart', 'library too;');
-    newFile2('$barRootPath/lib/bar.dart', 'library bar;');
+    newFile('$fooRootPath/lib/foo.dart', 'library foo;');
+    newFile('$fooRootPath/lib/baz/too.dart', 'library too;');
+    newFile('$barRootPath/lib/bar.dart', 'library bar;');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -144,9 +144,9 @@
 
   Future<void> test_import_file() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('import "^" import');
     await computeSuggestions();
@@ -162,9 +162,9 @@
 
   Future<void> test_import_file2() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('import "..^" import');
     await computeSuggestions();
@@ -180,9 +180,9 @@
 
   Future<void> test_import_file_child() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('import "foo/^" import');
     await computeSuggestions();
@@ -197,10 +197,10 @@
   }
 
   Future<void> test_import_file_outside_lib() async {
-    newFile2('$testPackageLibPath/other.dart', '');
-    newFile2('$testPackageLibPath/foo/bar.dart', '');
-    newFile2('$testPackageRootPath/blat.dart', '');
-    newFile2('$testPackageRootPath/bin/boo.dart', '');
+    newFile('$testPackageLibPath/other.dart', '');
+    newFile('$testPackageLibPath/foo/bar.dart', '');
+    newFile('$testPackageRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/bin/boo.dart', '');
 
     addTestSource('import "../^" import');
     await computeSuggestions();
@@ -218,10 +218,10 @@
 
   Future<void> test_import_file_parent() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
-    newFile2('$workspaceRootPath/aaa/boo.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
+    newFile('$workspaceRootPath/aaa/boo.dart', '');
 
     addTestSource('import "../^" import');
     await computeSuggestions();
@@ -238,9 +238,9 @@
 
   Future<void> test_import_file_parent2() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('import "../b^" import');
     await computeSuggestions();
@@ -265,7 +265,7 @@
 
   Future<void> test_import_only_dart_files() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
     newAnalysisOptionsYamlFile2(testPackageRootPath, '');
 
     addTestSource('import "package:^";');
@@ -276,9 +276,9 @@
   Future<void> test_import_package() async {
     var fooRootPath = '$workspaceRootPath/foo';
     var barRootPath = '$workspaceRootPath/bar';
-    newFile2('$fooRootPath/lib/foo.dart', '');
-    newFile2('$fooRootPath/lib/baz/too.dart', '');
-    newFile2('$barRootPath/lib/bar.dart', '');
+    newFile('$fooRootPath/lib/foo.dart', '');
+    newFile('$fooRootPath/lib/baz/too.dart', '');
+    newFile('$barRootPath/lib/bar.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -304,9 +304,9 @@
   Future<void> test_import_package2() async {
     var fooRootPath = '$workspaceRootPath/foo';
     var barRootPath = '$workspaceRootPath/bar';
-    newFile2('$fooRootPath/lib/foo.dart', '');
-    newFile2('$fooRootPath/lib/baz/too.dart', '');
-    newFile2('$barRootPath/lib/bar.dart', '');
+    newFile('$fooRootPath/lib/foo.dart', '');
+    newFile('$fooRootPath/lib/baz/too.dart', '');
+    newFile('$barRootPath/lib/bar.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -323,9 +323,9 @@
   Future<void> test_import_package2_raw() async {
     var fooRootPath = '$workspaceRootPath/foo';
     var barRootPath = '$workspaceRootPath/bar';
-    newFile2('$fooRootPath/lib/foo.dart', '');
-    newFile2('$fooRootPath/lib/baz/too.dart', '');
-    newFile2('$barRootPath/lib/bar.dart', '');
+    newFile('$fooRootPath/lib/foo.dart', '');
+    newFile('$fooRootPath/lib/baz/too.dart', '');
+    newFile('$barRootPath/lib/bar.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -342,9 +342,9 @@
   Future<void> test_import_package2_with_trailing() async {
     var fooRootPath = '$workspaceRootPath/foo';
     var barRootPath = '$workspaceRootPath/bar';
-    newFile2('$fooRootPath/lib/foo.dart', '');
-    newFile2('$fooRootPath/lib/baz/too.dart', '');
-    newFile2('$barRootPath/lib/bar.dart', '');
+    newFile('$fooRootPath/lib/foo.dart', '');
+    newFile('$fooRootPath/lib/baz/too.dart', '');
+    newFile('$barRootPath/lib/bar.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -379,9 +379,9 @@
   Future<void> test_import_package_raw() async {
     var fooRootPath = '$workspaceRootPath/foo';
     var barRootPath = '$workspaceRootPath/bar';
-    newFile2('$fooRootPath/lib/foo.dart', '');
-    newFile2('$fooRootPath/lib/baz/too.dart', '');
-    newFile2('$barRootPath/lib/bar.dart', '');
+    newFile('$fooRootPath/lib/foo.dart', '');
+    newFile('$fooRootPath/lib/baz/too.dart', '');
+    newFile('$barRootPath/lib/bar.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -479,9 +479,9 @@
 
   Future<void> test_part_file() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('library x; part "^" import');
     await computeSuggestions();
@@ -497,9 +497,9 @@
 
   Future<void> test_part_file2() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('library x; part "..^" import');
     await computeSuggestions();
@@ -515,9 +515,9 @@
 
   Future<void> test_part_file_child() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('library x; part "foo/^" import');
     await computeSuggestions();
@@ -533,9 +533,9 @@
 
   Future<void> test_part_file_parent() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('library x; part "../^" import');
     await computeSuggestions();
@@ -567,9 +567,9 @@
 
   Future<void> test_import_file() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('import "^" import');
     await computeSuggestions();
@@ -585,9 +585,9 @@
 
   Future<void> test_import_file2() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('import "..^" import');
     await computeSuggestions();
@@ -603,9 +603,9 @@
 
   Future<void> test_import_file_child() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('import "foo/^" import');
     await computeSuggestions();
@@ -621,9 +621,9 @@
 
   Future<void> test_import_file_parent() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('import "../^" import');
     await computeSuggestions();
@@ -639,9 +639,9 @@
 
   Future<void> test_import_file_parent2() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('import "../b^" import');
     await computeSuggestions();
@@ -657,9 +657,9 @@
 
   Future<void> test_part_file() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('library x; part "^" import');
     await computeSuggestions();
@@ -675,9 +675,9 @@
 
   Future<void> test_part_file2() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('library x; part "..^" import');
     await computeSuggestions();
@@ -693,9 +693,9 @@
 
   Future<void> test_part_file_child() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('library x; part "foo/^" import');
     await computeSuggestions();
@@ -711,9 +711,9 @@
 
   Future<void> test_part_file_parent() async {
     testFile = convertPath('$testPackageRootPath/test.dart');
-    newFile2('$testPackageRootPath/other.dart', '');
-    newFile2('$testPackageRootPath/foo/bar.dart', '');
-    newFile2('$workspaceRootPath/blat.dart', '');
+    newFile('$testPackageRootPath/other.dart', '');
+    newFile('$testPackageRootPath/foo/bar.dart', '');
+    newFile('$workspaceRootPath/blat.dart', '');
 
     addTestSource('library x; part "../^" import');
     await computeSuggestions();
diff --git a/pkg/analysis_server/test/services/completion/postfix/postfix_completion_test.dart b/pkg/analysis_server/test/services/completion/postfix/postfix_completion_test.dart
index fa81e8d..1e47e9d 100644
--- a/pkg/analysis_server/test/services/completion/postfix/postfix_completion_test.dart
+++ b/pkg/analysis_server/test/services/completion/postfix/postfix_completion_test.dart
@@ -739,7 +739,7 @@
   }
 
   Future<void> test_tryonThrowStatement_nnbd_into_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 String? x;
 ''');
     await _prepareCompletion('.tryon', '''
@@ -763,7 +763,7 @@
   }
 
   Future<void> test_tryonThrowStatement_nnbd_into_legacy_nested() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 List<String?> x;
 ''');
     await _prepareCompletion('.tryon', '''
@@ -787,7 +787,7 @@
   }
 
   Future<void> test_tryonThrowStatement_nnbd_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.8
 String x;
 ''');
@@ -810,7 +810,7 @@
   }
 
   Future<void> test_tryonThrowStatement_nnbd_legacy_nested() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.8
 List<String> x;
 ''');
diff --git a/pkg/analysis_server/test/services/correction/util_test.dart b/pkg/analysis_server/test/services/correction/util_test.dart
index 3269037..a88aa8e 100644
--- a/pkg/analysis_server/test/services/correction/util_test.dart
+++ b/pkg/analysis_server/test/services/correction/util_test.dart
@@ -196,8 +196,8 @@
 
   Future<void>
       test_addLibraryImports_package_hasDart_hasPackages_insertAfter() async {
-    newFile2('$workspaceRootPath/aaa/lib/aaa.dart', '');
-    newFile2('$workspaceRootPath/bbb/lib/bbb.dart', '');
+    newFile('$workspaceRootPath/aaa/lib/aaa.dart', '');
+    newFile('$workspaceRootPath/bbb/lib/bbb.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -221,8 +221,8 @@
 
   Future<void>
       test_addLibraryImports_package_hasDart_hasPackages_insertBefore() async {
-    newFile2('$workspaceRootPath/aaa/lib/aaa.dart', '');
-    newFile2('$workspaceRootPath/bbb/lib/bbb.dart', '');
+    newFile('$workspaceRootPath/aaa/lib/aaa.dart', '');
+    newFile('$workspaceRootPath/bbb/lib/bbb.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -245,10 +245,10 @@
   }
 
   Future<void> test_addLibraryImports_package_hasImports_between() async {
-    newFile2('$workspaceRootPath/aaa/lib/aaa.dart', '');
-    newFile2('$workspaceRootPath/bbb/lib/bbb.dart', '');
-    newFile2('$workspaceRootPath/ccc/lib/ccc.dart', '');
-    newFile2('$workspaceRootPath/ddd/lib/ddd.dart', '');
+    newFile('$workspaceRootPath/aaa/lib/aaa.dart', '');
+    newFile('$workspaceRootPath/bbb/lib/bbb.dart', '');
+    newFile('$workspaceRootPath/ccc/lib/ccc.dart', '');
+    newFile('$workspaceRootPath/ddd/lib/ddd.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
diff --git a/pkg/analysis_server/test/services/refactoring/move_file_test.dart b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
index bb098d2..6a02009 100644
--- a/pkg/analysis_server/test/services/refactoring/move_file_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/move_file_test.dart
@@ -24,10 +24,10 @@
   Future<void> test_file_containing_imports_exports_parts() async {
     final root = '/home/test/000/1111';
     testFile = convertPath('$root/test.dart');
-    newFile2('/absolute/uri.dart', '');
-    final fileA = newFile2('$root/a.dart', 'part of lib;');
-    final fileB = newFile2('$root/b.dart', "import 'test.dart';");
-    final fileC = newFile2('$root/22/c.dart', '');
+    newFile('/absolute/uri.dart', '');
+    final fileA = newFile('$root/a.dart', 'part of lib;');
+    final fileB = newFile('$root/b.dart', "import 'test.dart';");
+    final fileC = newFile('$root/22/c.dart', '');
     verifyNoTestUnitErrors = false;
     await resolveTestCode('''
 library lib;
@@ -55,7 +55,7 @@
   }
 
   Future<void> test_file_imported_with_package_uri_down() async {
-    var file = newFile2('$testPackageLibPath/old_name.dart', '');
+    var file = newFile('$testPackageLibPath/old_name.dart', '');
     addTestSource(r'''
 import 'package:test/old_name.dart';
 ''');
@@ -79,7 +79,7 @@
   @failingTest
   Future<void> test_file_imported_with_package_uri_lib_change() async {
     // The current testing stack does not support creating such bazel roots
-    var file = newFile2('/home/test0/test1/test2/lib/111/name.dart', '');
+    var file = newFile('/home/test0/test1/test2/lib/111/name.dart', '');
     addTestSource(r'''
 import 'package:test0.test1.test2/111/name.dart';
 ''');
@@ -102,7 +102,7 @@
   @failingTest
   Future<void> test_file_imported_with_package_uri_lib_change_down() async {
     // The current testing stack does not support creating such bazel roots
-    var file = newFile2('/home/test0/test1/test2/lib/111/name.dart', '');
+    var file = newFile('/home/test0/test1/test2/lib/111/name.dart', '');
     addTestSource(r'''
 import 'package:test0.test1.test2/111/name.dart';
 ''');
@@ -125,7 +125,7 @@
   @failingTest
   Future<void> test_file_imported_with_package_uri_lib_change_up() async {
     // The current testing stack does not support creating such bazel roots
-    var file = newFile2('/home/test0/test1/test2/lib/111/name.dart', '');
+    var file = newFile('/home/test0/test1/test2/lib/111/name.dart', '');
     addTestSource(r'''
 import 'package:test0.test1.test2/111/name.dart';
 ''');
@@ -146,7 +146,7 @@
   }
 
   Future<void> test_file_imported_with_package_uri_sideways() async {
-    var file = newFile2('$testPackageLibPath/111/old_name.dart', '');
+    var file = newFile('$testPackageLibPath/111/old_name.dart', '');
     addTestSource(r'''
 import 'package:test/111/old_name.dart';
 ''');
@@ -168,7 +168,7 @@
   }
 
   Future<void> test_file_imported_with_package_uri_up() async {
-    var file = newFile2('$testPackageLibPath/222/old_name.dart', '');
+    var file = newFile('$testPackageLibPath/222/old_name.dart', '');
     addTestSource(r'''
 import 'package:test/222/old_name.dart';
 ''');
diff --git a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
index 7ce9136..181bd4a 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_class_member_test.dart
@@ -740,7 +740,7 @@
 
   Future<void> test_createChange_MethodElement_potential_inPubCache() async {
     var externalPath = '$packagesRootPath/aaa/lib/lib.dart';
-    newFile2(externalPath, r'''
+    newFile(externalPath, r'''
 processObj(p) {
   p.test();
 }
@@ -819,7 +819,7 @@
   }
 
   Future<void> test_createChange_outsideOfProject_declarationInPackage() async {
-    newFile2('$workspaceRootPath/aaa/lib/aaa.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/aaa.dart', r'''
 class A {
   void test() {}
 }
@@ -867,7 +867,7 @@
   }
 
   Future<void> test_createChange_outsideOfProject_referenceInPart() async {
-    newFile2('/home/part.dart', r'''
+    newFile('/home/part.dart', r'''
 part of test;
 
 void foo(A a) {
diff --git a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
index 5d0000b..9ec5f7b 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_local_test.dart
@@ -475,12 +475,12 @@
     var a = convertPath('$testPackageLibPath/a.dart');
     var b = convertPath('$testPackageLibPath/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A {
   A({test});
 }
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 import 'a.dart';
 
 void f() {
diff --git a/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart b/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
index 34c0d21..4c6fc40 100644
--- a/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
+++ b/pkg/analysis_server/test/services/refactoring/rename_unit_member_test.dart
@@ -236,7 +236,7 @@
   }
 
   Future<void> test_checkInitialConditions_outsideOfProject() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {}
 ''');
 
@@ -644,7 +644,7 @@
   }
 
   Future<void> test_createChange_outsideOfProject_referenceInPart() async {
-    newFile2('/home/part.dart', r'''
+    newFile('/home/part.dart', r'''
 part of test;
 
 Test test2;
diff --git a/pkg/analysis_server/test/services/search/search_engine_test.dart b/pkg/analysis_server/test/services/search/search_engine_test.dart
index c80a680..71b35a2 100644
--- a/pkg/analysis_server/test/services/search/search_engine_test.dart
+++ b/pkg/analysis_server/test/services/search/search_engine_test.dart
@@ -31,7 +31,7 @@
   String get testFilePath => '$testPackageLibPath/test.dart';
 
   void addTestFile(String content) {
-    newFile2(testFilePath, content);
+    newFile(testFilePath, content);
   }
 
   /// Resolve the file with the [path] into [result].
@@ -62,7 +62,7 @@
   }
 
   Future<void> test_membersOfSubtypes_classByClass_hasMembers() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   void a() {}
   void b() {}
@@ -70,14 +70,14 @@
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart';
 class B extends A {
   void a() {}
 }
 ''');
 
-    newFile2('$testPackageLibPath/c.dart', '''
+    newFile('$testPackageLibPath/c.dart', '''
 import 'a.dart';
 class C extends A {
   void b() {}
@@ -126,7 +126,7 @@
   }
 
   Future<void> test_membersOfSubtypes_noMembers() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   void a() {}
   void b() {}
@@ -134,7 +134,7 @@
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart';
 class B extends A {}
 ''');
@@ -147,7 +147,7 @@
   }
 
   Future<void> test_membersOfSubtypes_noSubtypes() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   void a() {}
   void b() {}
@@ -155,7 +155,7 @@
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart';
 class B {
   void a() {}
@@ -170,7 +170,7 @@
   }
 
   Future<void> test_membersOfSubtypes_private() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   void a() {}
   void _b() {}
@@ -181,7 +181,7 @@
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart';
 class C extends A {
   void a() {}
@@ -219,12 +219,12 @@
   Future<void> test_searchAllSubtypes_acrossDrivers() async {
     var aaaRootPath = _configureForPackage_aaa();
 
-    newFile2('$aaaRootPath/lib/a.dart', '''
+    newFile('$aaaRootPath/lib/a.dart', '''
 class T {}
 class A extends T {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 import 'package:aaa/a.dart';
 class B extends A {}
 class C extends B {}
@@ -279,8 +279,8 @@
 int test;
 ''';
 
-    newFile2('$testPackageLibPath/a.dart', codeA);
-    newFile2('$testPackageLibPath/b.dart', codeB);
+    newFile('$testPackageLibPath/a.dart', codeA);
+    newFile('$testPackageLibPath/b.dart', codeB);
 
     var matches = await searchEngine.searchMemberDeclarations('test');
     expect(matches, hasLength(2));
@@ -299,7 +299,7 @@
   }
 
   Future<void> test_searchMemberReferences() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   int test;
 }
@@ -308,7 +308,7 @@
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart';
 bar(p) {
   p.test = 1;
@@ -330,7 +330,7 @@
   Future<void> test_searchReferences() async {
     var aaaRootPath = _configureForPackage_aaa();
 
-    newFile2('$aaaRootPath/lib/a.dart', '''
+    newFile('$aaaRootPath/lib/a.dart', '''
 class T {}
 T a;
 ''');
@@ -352,11 +352,11 @@
   Future<void> test_searchReferences_discover_owned() async {
     var aaaRootPath = _configureForPackage_aaa();
 
-    var a = newFile2('$aaaRootPath/lib/a.dart', '''
+    var a = newFile('$aaaRootPath/lib/a.dart', '''
 int a;
 ''').path;
 
-    var t = newFile2('$testPackageLibPath/lib/t.dart', '''
+    var t = newFile('$testPackageLibPath/lib/t.dart', '''
 import 'package:aaa/a.dart';
 int t;
 ''').path;
@@ -497,12 +497,12 @@
   }
 
   Future<void> test_searchTopLevelDeclarations() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {}
 int a;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 class B {}
 get b => 42;
 ''');
@@ -528,13 +528,13 @@
   Future<void> test_searchTopLevelDeclarations_dependentPackage() async {
     var aaaRootPath = _configureForPackage_aaa();
 
-    newFile2('$aaaRootPath/lib/a.dart', '''
+    newFile('$aaaRootPath/lib/a.dart', '''
 class A {}
 ''');
 
     // The `package:test` uses the class `A` from the `package:aaa`.
     // So it sees the declaration the element `A`.
-    newFile2(testFilePath, '''
+    newFile(testFilePath, '''
 import 'package:aaa/a.dart';
 class B extends A {}
 ''');
diff --git a/pkg/analysis_server/test/src/cider/assists_test.dart b/pkg/analysis_server/test/src/cider/assists_test.dart
index d4182cb..ffd68d6 100644
--- a/pkg/analysis_server/test/src/cider/assists_test.dart
+++ b/pkg/analysis_server/test/src/cider/assists_test.dart
@@ -132,7 +132,7 @@
     var location = lineInfo.getLocation(offset);
 
     content = content.substring(0, offset) + content.substring(offset + 1);
-    newFile2(testPath, content);
+    newFile(testPath, content);
 
     _correctionContext = _CorrectionContext(
       content,
diff --git a/pkg/analysis_server/test/src/cider/cider_service.dart b/pkg/analysis_server/test/src/cider/cider_service.dart
index 0e40f53..fbc50e9 100644
--- a/pkg/analysis_server/test/src/cider/cider_service.dart
+++ b/pkg/analysis_server/test/src/cider/cider_service.dart
@@ -51,8 +51,8 @@
 
     logger = PerformanceLog(logBuffer);
 
-    newFile2('/workspace/WORKSPACE', '');
-    newFile2('/workspace/dart/test/BUILD', '');
+    newFile('/workspace/WORKSPACE', '');
+    newFile('/workspace/dart/test/BUILD', '');
     createFileResolver();
   }
 
diff --git a/pkg/analysis_server/test/src/cider/completion_test.dart b/pkg/analysis_server/test/src/cider/completion_test.dart
index 06ee178..e270153 100644
--- a/pkg/analysis_server/test/src/cider/completion_test.dart
+++ b/pkg/analysis_server/test/src/cider/completion_test.dart
@@ -112,7 +112,7 @@
 
   Future<void> test_compute_updateImportedLibrary() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {}
 ''');
 
@@ -132,7 +132,7 @@
     _assertHasClass(text: 'A');
 
     // Update the imported library, has 'B', but not 'A'.
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class B {}
 ''');
     _createFileResolver();
@@ -144,7 +144,7 @@
 
   Future<void> test_compute_updateImports() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {}
 ''');
 
@@ -166,7 +166,7 @@
   }
 
   Future<void> test_compute_uriContributor_disabled() async {
-    newFile2('/workspace/dart/test/lib/a.dart', '');
+    newFile('/workspace/dart/test/lib/a.dart', '');
     await _compute(r'''
 import '^';
 ''');
@@ -474,7 +474,7 @@
   }
 
   Future<void> test_limitedResolution_hasPart() async {
-    newFile2('/workspace/dart/test/lib/a.dart', r'''
+    newFile('/workspace/dart/test/lib/a.dart', r'''
 class A {}
 ''');
 
@@ -488,7 +488,7 @@
   }
 
   Future<void> test_limitedResolution_inPart_partOfName() async {
-    newFile2('/workspace/dart/test/lib/a.dart', r'''
+    newFile('/workspace/dart/test/lib/a.dart', r'''
 library my_lib;
 part 'test.dart';
 class A {}
@@ -504,7 +504,7 @@
   }
 
   Future<void> test_limitedResolution_inPart_partOfUri() async {
-    newFile2('/workspace/dart/test/lib/a.dart', r'''
+    newFile('/workspace/dart/test/lib/a.dart', r'''
 part 'test.dart';
 class A {}
 ''');
@@ -599,12 +599,12 @@
 
   Future<void> test_warmUp_cachesImportedLibraries() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {}
 ''');
 
     var bPath = convertPath('/workspace/dart/test/lib/b.dart');
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 ''');
 
@@ -885,7 +885,7 @@
     var location = lineInfo.getLocation(offset);
 
     content = content.substring(0, offset) + content.substring(offset + 1);
-    newFile2(testPath, content);
+    newFile(testPath, content);
 
     return _CompletionContext(
       content,
diff --git a/pkg/analysis_server/test/src/cider/document_symbols_test.dart b/pkg/analysis_server/test/src/cider/document_symbols_test.dart
index 84563f3..7f59ea4 100644
--- a/pkg/analysis_server/test/src/cider/document_symbols_test.dart
+++ b/pkg/analysis_server/test/src/cider/document_symbols_test.dart
@@ -269,7 +269,7 @@
   }
 
   Future<List<DocumentSymbol>> _compute(String content) async {
-    newFile2(testPath, content);
+    newFile(testPath, content);
     return CiderDocumentSymbolsComputer(
       fileResolver,
     ).compute2(convertPath(testPath));
diff --git a/pkg/analysis_server/test/src/cider/fixes_test.dart b/pkg/analysis_server/test/src/cider/fixes_test.dart
index 0d08766..66f85fa 100644
--- a/pkg/analysis_server/test/src/cider/fixes_test.dart
+++ b/pkg/analysis_server/test/src/cider/fixes_test.dart
@@ -73,7 +73,7 @@
   }
 
   Future<void> test_importLibrary_withClass() async {
-    var a = newFile2('/workspace/dart/test/lib/a.dart', r'''
+    var a = newFile('/workspace/dart/test/lib/a.dart', r'''
 class Test {}
 ''');
     await fileResolver.resolve2(path: a.path);
@@ -90,7 +90,7 @@
   }
 
   Future<void> test_importLibrary_withEnum() async {
-    var a = newFile2('/workspace/dart/test/lib/a.dart', r'''
+    var a = newFile('/workspace/dart/test/lib/a.dart', r'''
 enum Test {a, b, c}
 ''');
     await fileResolver.resolve2(path: a.path);
@@ -107,7 +107,7 @@
   }
 
   Future<void> test_importLibrary_withExtension() async {
-    var a = newFile2('/workspace/dart/test/lib/a.dart', r'''
+    var a = newFile('/workspace/dart/test/lib/a.dart', r'''
 extension E on int {
   void foo() {}
 }
@@ -130,7 +130,7 @@
   }
 
   Future<void> test_importLibrary_withFunction() async {
-    var a = newFile2('/workspace/dart/test/lib/a.dart', r'''
+    var a = newFile('/workspace/dart/test/lib/a.dart', r'''
 void foo() {}
 ''');
     await fileResolver.resolve2(path: a.path);
@@ -151,7 +151,7 @@
   }
 
   Future<void> test_importLibrary_withMixin() async {
-    var a = newFile2('/workspace/dart/test/lib/a.dart', r'''
+    var a = newFile('/workspace/dart/test/lib/a.dart', r'''
 mixin Test {}
 ''');
     await fileResolver.resolve2(path: a.path);
@@ -168,7 +168,7 @@
   }
 
   Future<void> test_importLibrary_withTopLevelVariable() async {
-    var a = newFile2('/workspace/dart/test/lib/a.dart', r'''
+    var a = newFile('/workspace/dart/test/lib/a.dart', r'''
 var a = 0;
 ''');
     await fileResolver.resolve2(path: a.path);
@@ -230,7 +230,7 @@
     var location = lineInfo.getLocation(offset);
 
     content = content.substring(0, offset) + content.substring(offset + 1);
-    newFile2(testPath, content);
+    newFile(testPath, content);
 
     _correctionContext = _CorrectionContext(
       content,
diff --git a/pkg/analysis_server/test/src/cider/rename_test.dart b/pkg/analysis_server/test/src/cider/rename_test.dart
index ac912a4..4adefd9 100644
--- a/pkg/analysis_server/test/src/cider/rename_test.dart
+++ b/pkg/analysis_server/test/src/cider/rename_test.dart
@@ -325,7 +325,7 @@
   }
 
   void test_rename_function_imported() async {
-    var a = newFile2('/workspace/dart/test/lib/a.dart', r'''
+    var a = newFile('/workspace/dart/test/lib/a.dart', r'''
 foo() {}
 ''');
     await fileResolver.resolve2(path: a.path);
@@ -360,7 +360,7 @@
   }
 
   void test_rename_method_imported() async {
-    var a = newFile2('/workspace/dart/test/lib/a.dart', r'''
+    var a = newFile('/workspace/dart/test/lib/a.dart', r'''
 class A {
   foo() {}
 }
@@ -471,7 +471,7 @@
     var location = lineInfo.getLocation(offset);
 
     content = content.substring(0, offset) + content.substring(offset + 1);
-    newFile2(testPath, content);
+    newFile(testPath, content);
 
     _correctionContext = _CorrectionContext(
       content,
diff --git a/pkg/analysis_server/test/src/cider/signature_help_test.dart b/pkg/analysis_server/test/src/cider/signature_help_test.dart
index b4ea6aa..ca6c2ca 100644
--- a/pkg/analysis_server/test/src/cider/signature_help_test.dart
+++ b/pkg/analysis_server/test/src/cider/signature_help_test.dart
@@ -232,7 +232,7 @@
     var location = lineInfo.getLocation(offset);
 
     content = content.substring(0, offset) + content.substring(offset + 1);
-    newFile2(testPath, content);
+    newFile(testPath, content);
 
     _correctionContext = _CorrectionContext(
       content,
diff --git a/pkg/analysis_server/test/src/computer/closing_labels_computer_test.dart b/pkg/analysis_server/test/src/computer/closing_labels_computer_test.dart
index 0aa5e78..a106b40 100644
--- a/pkg/analysis_server/test/src/computer/closing_labels_computer_test.dart
+++ b/pkg/analysis_server/test/src/computer/closing_labels_computer_test.dart
@@ -396,7 +396,7 @@
   }
 
   Future<List<ClosingLabel>> _computeElements(String sourceContent) async {
-    newFile2(sourcePath, sourceContent);
+    newFile(sourcePath, sourceContent);
     var result =
         await (await session).getResolvedUnit(sourcePath) as ResolvedUnitResult;
     var computer = DartUnitClosingLabelsComputer(result.lineInfo, result.unit);
diff --git a/pkg/analysis_server/test/src/computer/color_computer_test.dart b/pkg/analysis_server/test/src/computer/color_computer_test.dart
index 2083610..43e6469 100644
--- a/pkg/analysis_server/test/src/computer/color_computer_test.dart
+++ b/pkg/analysis_server/test/src/computer/color_computer_test.dart
@@ -127,9 +127,9 @@
     dartCode = _withCommonImports(dartCode);
     otherCode = otherCode != null ? _withCommonImports(otherCode) : null;
 
-    newFile2(testPath, dartCode);
+    newFile(testPath, dartCode);
     if (otherCode != null) {
-      newFile2(otherPath, otherCode);
+      newFile(otherPath, otherCode);
       final otherResult = await (await session).getResolvedUnit(otherPath)
           as ResolvedUnitResult;
       expectNoErrors(otherResult);
diff --git a/pkg/analysis_server/test/src/computer/folding_computer_test.dart b/pkg/analysis_server/test/src/computer/folding_computer_test.dart
index 7ee425d..a0ce7df7 100644
--- a/pkg/analysis_server/test/src/computer/folding_computer_test.dart
+++ b/pkg/analysis_server/test/src/computer/folding_computer_test.dart
@@ -580,7 +580,7 @@
   }
 
   Future<List<FoldingRegion>> _computeRegions(String sourceContent) async {
-    newFile2(sourcePath, sourceContent);
+    newFile(sourcePath, sourceContent);
     var result =
         await (await session).getResolvedUnit(sourcePath) as ResolvedUnitResult;
     var computer = DartUnitFoldingComputer(result.lineInfo, result.unit);
diff --git a/pkg/analysis_server/test/src/computer/highlights_computer_test.dart b/pkg/analysis_server/test/src/computer/highlights_computer_test.dart
index a38a867..939b4b3 100644
--- a/pkg/analysis_server/test/src/computer/highlights_computer_test.dart
+++ b/pkg/analysis_server/test/src/computer/highlights_computer_test.dart
@@ -112,7 +112,7 @@
     bool hasErrors = false,
   }) async {
     this.content = content;
-    newFile2(sourcePath, content);
+    newFile(sourcePath, content);
     var result =
         await (await session).getResolvedUnit(sourcePath) as ResolvedUnitResult;
 
diff --git a/pkg/analysis_server/test/src/computer/import_elements_computer_test.dart b/pkg/analysis_server/test/src/computer/import_elements_computer_test.dart
index 9e66300..d83c58b 100644
--- a/pkg/analysis_server/test/src/computer/import_elements_computer_test.dart
+++ b/pkg/analysis_server/test/src/computer/import_elements_computer_test.dart
@@ -49,7 +49,7 @@
 
   Future<void> createBuilder(String content) async {
     originalContent = content;
-    newFile2(path, content);
+    newFile(path, content);
     var result =
         await (await session).getResolvedUnit(path) as ResolvedUnitResult;
     computer = ImportElementsComputer(resourceProvider, result);
@@ -81,7 +81,7 @@
   }
 
   Future<void> test_createEdits_addImport_noPrefix() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -101,7 +101,7 @@
   }
 
   Future<void> test_createEdits_addImport_prefix() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -121,7 +121,7 @@
   }
 
   Future<void> test_createEdits_addShow_multipleNames() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -142,7 +142,7 @@
   }
 
   Future<void> test_createEdits_addShow_removeHide() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -161,7 +161,7 @@
   }
 
   Future<void> test_createEdits_addShow_singleName_noPrefix() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -180,7 +180,7 @@
   }
 
   Future<void> test_createEdits_addShow_singleName_prefix() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -201,7 +201,7 @@
   }
 
   Future<void> test_createEdits_alreadyImported_noCombinators() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -218,7 +218,7 @@
   }
 
   Future<void> test_createEdits_alreadyImported_withPrefix() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -235,7 +235,7 @@
   }
 
   Future<void> test_createEdits_alreadyImported_withShow() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -264,7 +264,7 @@
   }
 
   Future<void> test_createEdits_invalidUri() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -290,7 +290,7 @@
   }
 
   Future<void> test_createEdits_removeHide_firstInCombinator() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -309,7 +309,7 @@
   }
 
   Future<void> test_createEdits_removeHide_lastInCombinator() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -328,7 +328,7 @@
   }
 
   Future<void> test_createEdits_removeHide_middleInCombinator() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -347,7 +347,7 @@
   }
 
   Future<void> test_createEdits_removeHide_multipleCombinators() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -366,7 +366,7 @@
   }
 
   Future<void> test_createEdits_removeHide_multipleNames() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -385,7 +385,7 @@
   }
 
   Future<void> test_createEdits_removeHideCombinator_first() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -404,7 +404,7 @@
   }
 
   Future<void> test_createEdits_removeHideCombinator_last() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -423,7 +423,7 @@
   }
 
   Future<void> test_createEdits_removeHideCombinator_middle() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -442,7 +442,7 @@
   }
 
   Future<void> test_createEdits_removeHideCombinator_only() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -461,7 +461,7 @@
   }
 
   Future<void> test_createEdits_removeHideCombinator_only_multiple() async {
-    var fooFile = newFile2('$workspaceRootPath/pkg/lib/foo.dart', '');
+    var fooFile = newFile('$workspaceRootPath/pkg/lib/foo.dart', '');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
diff --git a/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart b/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart
index c9f45ba..bc8f079 100644
--- a/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart
+++ b/pkg/analysis_server/test/src/computer/imported_elements_computer_test.dart
@@ -223,7 +223,7 @@
 
   Future<void> test_package_multipleInSame() async {
     var fooPath = '$workspaceRootPath/foo/lib/foo.dart';
-    newFile2(fooPath, '''
+    newFile(fooPath, '''
 class A {
   static String a = '';
 }
@@ -252,7 +252,7 @@
 
   Future<void> test_package_noPrefix() async {
     var fooPath = '$workspaceRootPath/foo/lib/foo.dart';
-    newFile2(fooPath, '''
+    newFile(fooPath, '''
 class Foo {
   static String first = '';
 }
@@ -278,7 +278,7 @@
 
   Future<void> test_package_prefix_selected_class() async {
     var fooPath = '$workspaceRootPath/foo/lib/foo.dart';
-    newFile2(fooPath, '''
+    newFile(fooPath, '''
 class Foo {
   static String first = '';
 }
@@ -304,7 +304,7 @@
 
   Future<void> test_package_prefix_selected_function() async {
     var fooPath = '$workspaceRootPath/foo/lib/foo.dart';
-    newFile2(fooPath, '''
+    newFile(fooPath, '''
 String foo() => '';
 ''');
 
@@ -328,7 +328,7 @@
 
   Future<void> test_package_prefix_selected_getter() async {
     var fooPath = '$workspaceRootPath/foo/lib/foo.dart';
-    newFile2(fooPath, '''
+    newFile(fooPath, '''
 String foo = '';
 ''');
 
@@ -352,7 +352,7 @@
 
   Future<void> test_package_prefix_selected_setter() async {
     var fooPath = '$workspaceRootPath/foo/lib/foo.dart';
-    newFile2(fooPath, '''
+    newFile(fooPath, '''
 String foo = '';
 ''');
 
@@ -376,7 +376,7 @@
 
   Future<void> test_package_prefix_unselected() async {
     var fooPath = '$workspaceRootPath/foo/lib/foo.dart';
-    newFile2(fooPath, '''
+    newFile(fooPath, '''
 class Foo {
   static String first = '';
 }
@@ -402,7 +402,7 @@
 
   Future<void> test_package_prefixedAndNot() async {
     var fooPath = '$workspaceRootPath/foo/lib/foo.dart';
-    newFile2(fooPath, '''
+    newFile(fooPath, '''
 class Foo {
   static String first = '';
   static String second = '';
@@ -469,7 +469,7 @@
 
   Future<void> _computeElements(String content, String selection) async {
     // TODO(brianwilkerson) Automatically extract the selection from the content.
-    newFile2(sourcePath, content);
+    newFile(sourcePath, content);
     var result =
         await (await session).getResolvedUnit(sourcePath) as ResolvedUnitResult;
     var computer = ImportedElementsComputer(
diff --git a/pkg/analysis_server/test/src/computer/outline_computer_test.dart b/pkg/analysis_server/test/src/computer/outline_computer_test.dart
index 25fdf23..dcf19c6 100644
--- a/pkg/analysis_server/test/src/computer/outline_computer_test.dart
+++ b/pkg/analysis_server/test/src/computer/outline_computer_test.dart
@@ -31,7 +31,7 @@
 
   Future<Outline> _computeOutline(String code) async {
     testCode = code;
-    newFile2(testPath, code);
+    newFile(testPath, code);
     var resolveResult =
         await (await session).getResolvedUnit(testPath) as ResolvedUnitResult;
     return DartUnitOutlineComputer(
diff --git a/pkg/analysis_server/test/src/computer/selection_range_computer_test.dart b/pkg/analysis_server/test/src/computer/selection_range_computer_test.dart
index 20fdbfd..63f1294 100644
--- a/pkg/analysis_server/test/src/computer/selection_range_computer_test.dart
+++ b/pkg/analysis_server/test/src/computer/selection_range_computer_test.dart
@@ -192,7 +192,7 @@
 
   Future<List<SelectionRange>?> _computeSelectionRanges(
       String sourceContent, int offset) async {
-    newFile2(sourcePath, sourceContent);
+    newFile(sourcePath, sourceContent);
     var result =
         await (await session).getResolvedUnit(sourcePath) as ResolvedUnitResult;
     var computer = DartSelectionRangeComputer(result.unit, offset);
diff --git a/pkg/analysis_server/test/src/domains/completion/available_suggestion_sets_test.dart b/pkg/analysis_server/test/src/domains/completion/available_suggestion_sets_test.dart
index 4b42e1a..15124db 100644
--- a/pkg/analysis_server/test/src/domains/completion/available_suggestion_sets_test.dart
+++ b/pkg/analysis_server/test/src/domains/completion/available_suggestion_sets_test.dart
@@ -26,7 +26,7 @@
 
     // Create the file, should get the set.
     {
-      newFile2(path, r'''
+      newFile(path, r'''
 class A {}
 ''');
       var set = await waitForSetWithUri(uriStr);
@@ -35,7 +35,7 @@
 
     // Update the file, should get the updated set.
     {
-      newFile2(path, r'''
+      newFile(path, r'''
 class B {}
 ''');
       removeSet(uriStr);
@@ -52,7 +52,7 @@
     var path = convertPath('/home/test/lib/a.dart');
     var uriStr = 'package:test/a.dart';
 
-    newFile2(path, r'''
+    newFile(path, r'''
 class A {
   A.a();
 }
@@ -120,7 +120,7 @@
     var path = convertPath('/home/test/lib/a.dart');
     var uriStr = 'package:test/a.dart';
 
-    newFile2(path, r'''
+    newFile(path, r'''
 abstract class A {
   A.a();
   factory A.b() => _B();
@@ -195,12 +195,12 @@
     var b_path = convertPath('/home/test/lib/b.dart');
     var a_uriStr = 'package:test/a.dart';
 
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 part 'b.dart';
 class A {}
 ''');
 
-    newFile2(b_path, r'''
+    newFile(b_path, r'''
 part of 'a.dart';
 class B {}
 ''');
@@ -264,7 +264,7 @@
     var path = convertPath('/home/test/lib/a.dart');
     var uriStr = 'package:test/a.dart';
 
-    newFile2(path, r'''
+    newFile(path, r'''
 enum MyEnum {
   aaa,
   bbb,
@@ -355,7 +355,7 @@
     var path = convertPath('/home/test/lib/a.dart');
     var uriStr = 'package:test/a.dart';
 
-    newFile2(path, r'''
+    newFile(path, r'''
 var boolV = false;
 var intV = 0;
 var doubleV = 0.1;
@@ -473,7 +473,7 @@
     var path = convertPath('/home/test/lib/a.dart');
     var uriStr = 'package:test/a.dart';
 
-    newFile2(path, r'''
+    newFile(path, r'''
 typedef MyAlias = double;
 ''');
 
@@ -509,7 +509,7 @@
     var path = convertPath('/home/test/lib/a.dart');
     var uriStr = 'package:test/a.dart';
 
-    newFile2(path, r'''
+    newFile(path, r'''
 typedef MyAlias = void Function();
 ''');
 
diff --git a/pkg/analysis_server/test/src/domains/completion/get_suggestion_details_test.dart b/pkg/analysis_server/test/src/domains/completion/get_suggestion_details_test.dart
index 1f6eae4..d2bb3cd 100644
--- a/pkg/analysis_server/test/src/domains/completion/get_suggestion_details_test.dart
+++ b/pkg/analysis_server/test/src/domains/completion/get_suggestion_details_test.dart
@@ -18,7 +18,7 @@
 @reflectiveTest
 class GetSuggestionDetailsTest extends AvailableSuggestionsBase {
   Future<void> test_enum() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 enum MyEnum {
   aaa, bbb
 }
@@ -223,7 +223,7 @@
 
 main() {} // ref
 ''';
-    var partFile = newFile2('/home/test/lib/a.dart', partCode);
+    var partFile = newFile('/home/test/lib/a.dart', partCode);
     addTestFile(r'''
 part 'a.dart';
 ''');
diff --git a/pkg/analysis_server/test/src/domains/completion/get_suggestions_available_test.dart b/pkg/analysis_server/test/src/domains/completion/get_suggestions_available_test.dart
index 725ebab..4dd9882 100644
--- a/pkg/analysis_server/test/src/domains/completion/get_suggestions_available_test.dart
+++ b/pkg/analysis_server/test/src/domains/completion/get_suggestions_available_test.dart
@@ -111,7 +111,7 @@
   }
 
   Future<void> test_defaultArgumentListString() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void fff(int aaa, int bbb) {}
 
 void ggg({int aaa, @required int bbb, @required int ccc}) {}
@@ -130,11 +130,11 @@
 
   Future<void> test_displayUri_file() async {
     var aPath = '$testPackageRootPath/test/a.dart';
-    newFile2(aPath, 'class A {}');
+    newFile(aPath, 'class A {}');
 
     var aSet = await waitForSetWithUri(toUriStr(aPath));
 
-    var file = newFile2('$testPackageRootPath/test/sub/test.dart', '');
+    var file = newFile('$testPackageRootPath/test/sub/test.dart', '');
     var results = await _getSuggestions(file, 0);
 
     expect(
@@ -146,10 +146,10 @@
   }
 
   Future<void> test_displayUri_package() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
 
     var aSet = await waitForSetWithUri('package:test/a.dart');
-    var file = newFile2('$testPackageLibPath/test.dart', '');
+    var file = newFile('$testPackageLibPath/test.dart', '');
 
     var results = await _getSuggestions(file, 0);
     expect(
@@ -217,9 +217,9 @@
   }
 
   Future<void> test_inHtml() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
 
-    var file = newFile2('$testPackageRoot/doc/a.html', '<html></html>');
+    var file = newFile('$testPackageRoot/doc/a.html', '<html></html>');
 
     await handleSuccessfulRequest(
       CompletionGetSuggestionsParams(file.path, 0).toRequest('0'),
@@ -256,7 +256,7 @@
   }
 
   Future<void> test_relevanceTags_enum() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 enum MyEnum {
   aaa, bbb
 }
diff --git a/pkg/analysis_server/test/src/domains/execution/completion_test.dart b/pkg/analysis_server/test/src/domains/execution/completion_test.dart
index b7cccdc..f6c37f6 100644
--- a/pkg/analysis_server/test/src/domains/execution/completion_test.dart
+++ b/pkg/analysis_server/test/src/domains/execution/completion_test.dart
@@ -335,8 +335,8 @@
 
   @FailingTest(reason: 'No support for OverlayResourceProvider')
   Future<void> test_syntheticImportPrefix() async {
-    newFile2('/test/lib/a.dart', 'class A {}');
-    newFile2('/test/lib/b.dart', 'class B {}');
+    newFile('/test/lib/a.dart', 'class A {}');
+    newFile('/test/lib/b.dart', 'class B {}');
     addContextFile(r'''
 import 'a.dart';
 impoty 'b.dart';
diff --git a/pkg/analysis_server/test/src/flutter/flutter_outline_computer_test.dart b/pkg/analysis_server/test/src/flutter/flutter_outline_computer_test.dart
index c698324..693ac67 100644
--- a/pkg/analysis_server/test/src/flutter/flutter_outline_computer_test.dart
+++ b/pkg/analysis_server/test/src/flutter/flutter_outline_computer_test.dart
@@ -234,7 +234,7 @@
   }
 
   Future<void> test_children_closure_blockBody() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:flutter/widgets.dart';
 
 class WidgetA extends StatelessWidget {
@@ -270,7 +270,7 @@
   }
 
   Future<void> test_children_closure_expressionBody() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:flutter/widgets.dart';
 
 class WidgetA extends StatelessWidget {
@@ -472,7 +472,7 @@
   }
 
   Future<void> test_namedArgument_anywhere() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:flutter/widgets.dart';
 
 class WidgetA extends StatelessWidget {
@@ -512,7 +512,7 @@
   }
 
   Future<void> test_parentAssociationLabel() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:flutter/widgets.dart';
 
 class WidgetA extends StatelessWidget {
@@ -584,7 +584,7 @@
 
   Future<FlutterOutline> _computeOutline(String code) async {
     testCode = code;
-    newFile2(testPath, code);
+    newFile(testPath, code);
     resolveResult =
         await (await session).getResolvedUnit(testPath) as ResolvedUnitResult;
     computer = FlutterOutlineComputer(resolveResult);
diff --git a/pkg/analysis_server/test/src/g3/fixes_test.dart b/pkg/analysis_server/test/src/g3/fixes_test.dart
index a90cff0..edef3dc 100644
--- a/pkg/analysis_server/test/src/g3/fixes_test.dart
+++ b/pkg/analysis_server/test/src/g3/fixes_test.dart
@@ -202,6 +202,6 @@
       }
     }
 
-    newFile2('/home/test/analysis_options.yaml', buffer.toString());
+    newFile('/home/test/analysis_options.yaml', buffer.toString());
   }
 }
diff --git a/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart b/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart
index e9d809e..8da3e4a 100644
--- a/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart
+++ b/pkg/analysis_server/test/src/plugin/plugin_manager_test.dart
@@ -480,7 +480,7 @@
     // a '.dart_tool/package_config.json' file.
     //
     var pluginDirPath = newFolder('/plugin').path;
-    var pluginFile = newFile2('/plugin/bin/plugin.dart', '');
+    var pluginFile = newFile('/plugin/bin/plugin.dart', '');
     var packageConfigFile = newPackageConfigJsonFile('/plugin', '');
     //
     // Test path computation.
@@ -494,14 +494,14 @@
     //
     // Build a Bazel workspace containing four packages, including the plugin.
     //
-    newFile2('/workspaceRoot/WORKSPACE', '');
+    newFile('/workspaceRoot/WORKSPACE', '');
     newFolder('/workspaceRoot/bazel-bin');
     newFolder('/workspaceRoot/bazel-genfiles');
 
     String newPackage(String packageName, [List<String>? dependencies]) {
       var packageRoot =
           newFolder('/workspaceRoot/third_party/dart/$packageName').path;
-      newFile2('$packageRoot/lib/$packageName.dart', '');
+      newFile('$packageRoot/lib/$packageName.dart', '');
       var buffer = StringBuffer();
       if (dependencies != null) {
         buffer.writeln('dependencies:');
@@ -517,7 +517,7 @@
     var bRootPath = newPackage('b', ['d']);
     var cRootPath = newPackage('c', ['d']);
     var dRootPath = newPackage('d');
-    var pluginFile = newFile2('$pluginDirPath/bin/plugin.dart', '');
+    var pluginFile = newFile('$pluginDirPath/bin/plugin.dart', '');
     //
     // Test path computation.
     //
diff --git a/pkg/analysis_server/test/src/plugin/plugin_watcher_test.dart b/pkg/analysis_server/test/src/plugin/plugin_watcher_test.dart
index 358bb99..4580491 100644
--- a/pkg/analysis_server/test/src/plugin/plugin_watcher_test.dart
+++ b/pkg/analysis_server/test/src/plugin/plugin_watcher_test.dart
@@ -36,7 +36,7 @@
 
   Future<void> test_addedDriver() async {
     newPubspecYamlFile('/foo', 'name: foo');
-    newFile2(
+    newFile(
       join('/foo', PluginLocator.toolsFolderName,
           PluginLocator.defaultPluginFolderName, 'bin', 'plugin.dart'),
       '',
diff --git a/pkg/analysis_server/test/src/services/completion/dart/completion_test.dart b/pkg/analysis_server/test/src/services/completion/dart/completion_test.dart
index f5d703b..d222e07 100644
--- a/pkg/analysis_server/test/src/services/completion/dart/completion_test.dart
+++ b/pkg/analysis_server/test/src/services/completion/dart/completion_test.dart
@@ -193,7 +193,7 @@
   }
 
   Future<void> test_explicitTarget_method_imported() async {
-    newFile2(convertPath('$testPackageLibPath/lib.dart'), '''
+    newFile(convertPath('$testPackageLibPath/lib.dart'), '''
 extension E on String {
   void m() {}
 }
@@ -208,7 +208,7 @@
   }
 
   Future<void> test_explicitTarget_method_inLibrary() async {
-    newFile2(convertPath('$testPackageLibPath/lib.dart'), '''
+    newFile(convertPath('$testPackageLibPath/lib.dart'), '''
 part 'test.dart';
 extension E on String {
   void m() {}
@@ -224,7 +224,7 @@
   }
 
   Future<void> test_explicitTarget_method_inPart() async {
-    newFile2(convertPath('$testPackageLibPath/part.dart'), '''
+    newFile(convertPath('$testPackageLibPath/part.dart'), '''
 extension E on String {
   void m() {}
 }
@@ -242,7 +242,7 @@
   Future<void> test_explicitTarget_method_notImported() async {
     // Available suggestions data doesn't yet have information about extension
     // methods.
-    newFile2(convertPath('/project/bin/lib.dart'), '''
+    newFile(convertPath('/project/bin/lib.dart'), '''
 extension E on String {
   void m() {}
 }
@@ -547,7 +547,7 @@
 
   @failingTest
   Future<void> test_unnamedConstructor_inDifferentLibrary() async {
-    newFile2('/project/bin/b.dart', '''
+    newFile('/project/bin/b.dart', '''
 class B implements A {
   B();
 }
@@ -659,7 +659,7 @@
 @reflectiveTest
 class SuperConstructorInvocationCompletionTest extends CompletionTestCase {
   Future<void> test_namedConstructor_notVisible() async {
-    newFile2('/project/bin/a.dart', '''
+    newFile('/project/bin/a.dart', '''
 class A {
   A._() {}
 }
diff --git a/pkg/analysis_server/test/src/services/completion/yaml/pubspec_generator_test.dart b/pkg/analysis_server/test/src/services/completion/yaml/pubspec_generator_test.dart
index d3d1e91..8d9926c 100644
--- a/pkg/analysis_server/test/src/services/completion/yaml/pubspec_generator_test.dart
+++ b/pkg/analysis_server/test/src/services/completion/yaml/pubspec_generator_test.dart
@@ -85,7 +85,7 @@
   }
 
   void test_flutter_assets_invalidPath() {
-    newFile2('/home/test/assets/img1.jpg', '');
+    newFile('/home/test/assets/img1.jpg', '');
     getCompletions('''
 flutter:
   assets:
@@ -95,7 +95,7 @@
   }
 
   void test_flutter_assets_nonExistentPath() {
-    newFile2('/home/test/assets/img1.jpg', '');
+    newFile('/home/test/assets/img1.jpg', '');
     getCompletions('''
 flutter:
   assets:
@@ -105,7 +105,7 @@
   }
 
   void test_flutter_assets_noPath() {
-    newFile2('/home/test/assets/img1.jpg', '');
+    newFile('/home/test/assets/img1.jpg', '');
     getCompletions('''
 flutter:
   assets:
@@ -115,7 +115,7 @@
   }
 
   void test_flutter_assets_partialPath() {
-    newFile2('/home/test/assets/img1.jpg', '');
+    newFile('/home/test/assets/img1.jpg', '');
     getCompletions('''
 flutter:
   assets:
@@ -125,7 +125,7 @@
   }
 
   void test_flutter_assets_path_withFollowing() {
-    newFile2('/home/test/assets/img1.jpg', '');
+    newFile('/home/test/assets/img1.jpg', '');
     getCompletions('''
 flutter:
   assets:
@@ -135,7 +135,7 @@
   }
 
   void test_flutter_assets_path_withoutFollowing() {
-    newFile2('/home/test/assets/img1.jpg', '');
+    newFile('/home/test/assets/img1.jpg', '');
     getCompletions('''
 flutter:
   assets:
@@ -380,7 +380,7 @@
       return MockProcess(1, 0, '', '');
     };
 
-    newFile2('/home/DEPS', '');
+    newFile('/home/DEPS', '');
     pubPackageService.beginCachePreloads([convertPath('/home/test/$fileName')]);
     await pumpEventQueue(times: 500);
 
diff --git a/pkg/analysis_server/test/src/services/completion/yaml/yaml_generator_test_support.dart b/pkg/analysis_server/test/src/services/completion/yaml/yaml_generator_test_support.dart
index c0c63d4..6a50900 100644
--- a/pkg/analysis_server/test/src/services/completion/yaml/yaml_generator_test_support.dart
+++ b/pkg/analysis_server/test/src/services/completion/yaml/yaml_generator_test_support.dart
@@ -57,7 +57,7 @@
     content = content.substring(0, completionOffset) +
         content.substring(completionOffset + 1);
     // Add the file to the file system.
-    var file = newFile2('/home/test/$fileName', content);
+    var file = newFile('/home/test/$fileName', content);
     // Generate completions.
     results = generator.getSuggestions(file.path, completionOffset).suggestions;
   }
diff --git a/pkg/analysis_server/test/src/services/correction/assist/convert_class_to_enum_test.dart b/pkg/analysis_server/test/src/services/correction/assist/convert_class_to_enum_test.dart
index 0eeb8a9..09f20b5 100644
--- a/pkg/analysis_server/test/src/services/correction/assist/convert_class_to_enum_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/assist/convert_class_to_enum_test.dart
@@ -321,7 +321,7 @@
   Future<void> test_invalid_hasPart() async {
     // Change this test if the assist becomes able to look for references to the
     // class and its constructors in part files.
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 part of 'test.dart';
 ''');
     await resolveTestCode('''
diff --git a/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_required_test.dart b/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_required_test.dart
index 5a9faa9..c23f105 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_required_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/add_missing_parameter_required_test.dart
@@ -166,7 +166,7 @@
   }
 
   Future<void> test_function_inPackage_inWorkspace() async {
-    newFile2('/home/aaa/lib/a.dart', 'void test() {}');
+    newFile('/home/aaa/lib/a.dart', 'void test() {}');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
@@ -193,7 +193,7 @@
   }
 
   Future<void> test_function_inPackage_outsideWorkspace() async {
-    newFile2('/home/bbb/lib/b.dart', 'void test() {}');
+    newFile('/home/bbb/lib/b.dart', 'void test() {}');
 
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
diff --git a/pkg/analysis_server/test/src/services/correction/fix/convert_to_package_import_test.dart b/pkg/analysis_server/test/src/services/correction/fix/convert_to_package_import_test.dart
index 7f66a9b..b952f84 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/convert_to_package_import_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/convert_to_package_import_test.dart
@@ -60,7 +60,7 @@
   String get lintCode => LintNames.always_use_package_imports;
 
   Future<void> test_relativeImport() async {
-    newFile2('$testPackageLibPath/foo.dart', '''
+    newFile('$testPackageLibPath/foo.dart', '''
 class Foo {}
 ''');
     await resolveTestCode('''
@@ -118,7 +118,7 @@
     // This test fails because any attempt to specify a relative path that
     // includes 'lib' (which the lint requires) results in a malformed URI when
     // trying to resolve the import.
-    newFile2('$testPackageLibPath/foo/bar.dart', '''
+    newFile('$testPackageLibPath/foo/bar.dart', '''
 class C {}
 ''');
     await resolveTestCode('''
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_constructor_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_constructor_test.dart
index 088e4bf..76ea6cb 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_constructor_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_constructor_test.dart
@@ -40,7 +40,7 @@
   FixKind get kind => DartFixKind.CREATE_CONSTRUCTOR;
 
   Future<void> test_inLibrary_insteadOfSyntheticDefault() async {
-    var a = newFile2('$testPackageLibPath/a.dart', '''
+    var a = newFile('$testPackageLibPath/a.dart', '''
 /// $_text200
 class A {}
 ''').path;
@@ -60,7 +60,7 @@
   }
 
   Future<void> test_inLibrary_named() async {
-    var a = newFile2('$testPackageLibPath/a.dart', '''
+    var a = newFile('$testPackageLibPath/a.dart', '''
 /// $_text200
 class A {}
 ''').path;
diff --git a/pkg/analysis_server/test/src/services/correction/fix/create_local_variable_test.dart b/pkg/analysis_server/test/src/services/correction/fix/create_local_variable_test.dart
index eb9fe9a..4bf0798 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/create_local_variable_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/create_local_variable_test.dart
@@ -158,13 +158,13 @@
   }
 
   Future<void> test_withImport() async {
-    newFile2('$workspaceRootPath/pkg/lib/a/a.dart', '''
+    newFile('$workspaceRootPath/pkg/lib/a/a.dart', '''
 class A {}
 ''');
-    newFile2('$workspaceRootPath/pkg/lib/b/b.dart', '''
+    newFile('$workspaceRootPath/pkg/lib/b/b.dart', '''
 class B {}
 ''');
-    newFile2('$workspaceRootPath/pkg/lib/c/c.dart', '''
+    newFile('$workspaceRootPath/pkg/lib/c/c.dart', '''
 import 'package:pkg/a/a.dart';
 import 'package:pkg/b/b.dart';
 
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test.dart
index aeffff8..968e3f2 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test.dart
@@ -576,7 +576,7 @@
   }
 
   Future<void> test_addParameter_withImport() async {
-    newFile2('$workspaceRootPath/p/lib/d.dart', '''
+    newFile('$workspaceRootPath/p/lib/d.dart', '''
 class D {}
 ''');
     setPackageContent('''
@@ -1356,14 +1356,14 @@
   /// Add the file containing the data used by the data-driven fix with the
   /// given [content].
   void addPackageDataFile(String content) {
-    newFile2('$workspaceRootPath/p/lib/${TransformSetManager.dataFileName}',
+    newFile('$workspaceRootPath/p/lib/${TransformSetManager.dataFileName}',
         content);
   }
 
   /// Set the content of the library that defines the element referenced by the
   /// data on which this test is based.
   void setPackageContent(String content) {
-    newFile2('$workspaceRootPath/p/lib/lib.dart', content);
+    newFile('$workspaceRootPath/p/lib/lib.dart', content);
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
         ..add(name: 'p', rootPath: '$workspaceRootPath/p'),
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test_support.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test_support.dart
index de94b4b..17043dd 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test_support.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/data_driven_test_support.dart
@@ -26,15 +26,14 @@
   /// Add the file containing the data used by the data-driven fix with the
   /// given [content].
   void addPackageDataFile(String content) {
-    newFile2('$workspaceRootPath/p/lib/${TransformSetManager.dataFileName}',
+    newFile('$workspaceRootPath/p/lib/${TransformSetManager.dataFileName}',
         content);
   }
 
   /// Add the file in the SDK containing the data used by the data-driven fix
   /// with the given [content].
   void addSdkDataFile(String content) {
-    newFile2(
-        '${sdkRoot.path}/lib/_internal/${TransformSetManager.dataFileName}',
+    newFile('${sdkRoot.path}/lib/_internal/${TransformSetManager.dataFileName}',
         content);
   }
 
@@ -52,7 +51,7 @@
   /// Set the content of the library that defines the element referenced by the
   /// data on which this test is based.
   void setPackageContent(String content) {
-    newFile2('$workspaceRootPath/p/lib/lib.dart', content);
+    newFile('$workspaceRootPath/p/lib/lib.dart', content);
     writeTestPackageConfig(
       config: PackageConfigFileBuilder()
         ..add(name: 'p', rootPath: '$workspaceRootPath/p'),
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/element_matcher_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/element_matcher_test.dart
index 327eb16..c39c4b6 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/element_matcher_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/element_matcher_test.dart
@@ -366,7 +366,7 @@
 
   Future<void> test_imports_package() async {
     var packageRootPath = '$workspaceRootPath/other';
-    newFile2('$packageRootPath/lib/other.dart', '');
+    newFile('$packageRootPath/lib/other.dart', '');
     writeTestPackageConfig(
         config: PackageConfigFileBuilder()
           ..add(name: 'other', rootPath: packageRootPath));
diff --git a/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_manager_test.dart b/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_manager_test.dart
index 2f7755b..7fc0e87 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_manager_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/data_driven/transform_set_manager_test.dart
@@ -52,7 +52,7 @@
   }
 
   void _addDataFile(String packageName) {
-    newFile2('$workspaceRootPath/$packageName/lib/fix_data.yaml', '''
+    newFile('$workspaceRootPath/$packageName/lib/fix_data.yaml', '''
 version: 1
 transforms:
 - title: 'Rename A'
diff --git a/pkg/analysis_server/test/src/services/correction/fix/import_library_project_test.dart b/pkg/analysis_server/test/src/services/correction/fix/import_library_project_test.dart
index db8bd08..e185798 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/import_library_project_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/import_library_project_test.dart
@@ -237,11 +237,11 @@
   Future<void> test_extension_otherPackage_exported_fromSrc() async {
     var pkgRootPath = '$packagesRootPath/aaa';
 
-    newFile2('$pkgRootPath/lib/a.dart', r'''
+    newFile('$pkgRootPath/lib/a.dart', r'''
 export 'src/b.dart';
 ''');
 
-    newFile2('$pkgRootPath/lib/src/b.dart', r'''
+    newFile('$pkgRootPath/lib/src/b.dart', r'''
 extension IntExtension on int {
   int get foo => 0;
 }
@@ -299,7 +299,7 @@
   }
 
   Future<void> test_lib() async {
-    newFile2('$packagesRootPath/my_pkg/lib/a.dart', '''
+    newFile('$packagesRootPath/my_pkg/lib/a.dart', '''
 class Test {}
 ''');
 
@@ -331,7 +331,7 @@
   }
 
   Future<void> test_lib_extension() async {
-    newFile2('$packagesRootPath/my_pkg/lib/a.dart', '''
+    newFile('$packagesRootPath/my_pkg/lib/a.dart', '''
 extension E on int {
   static String m() => '';
 }
@@ -363,7 +363,7 @@
   }
 
   Future<void> test_lib_src() async {
-    newFile2('$packagesRootPath/my_pkg/lib/src/a.dart', '''
+    newFile('$packagesRootPath/my_pkg/lib/src/a.dart', '''
 class Test {}
 ''');
 
@@ -718,7 +718,7 @@
 
   Future<void> test_withClass_pub_other_inLib_dependencies() async {
     var aaaRoot = getFolder('$packagesRootPath/aaa');
-    newFile2('${aaaRoot.path}/lib/a.dart', '''
+    newFile('${aaaRoot.path}/lib/a.dart', '''
 class Test {}
 ''');
 
@@ -746,7 +746,7 @@
 
   Future<void> test_withClass_pub_other_inLib_devDependencies() async {
     var aaaRoot = getFolder('$packagesRootPath/aaa');
-    newFile2('${aaaRoot.path}/lib/a.dart', '''
+    newFile('${aaaRoot.path}/lib/a.dart', '''
 class Test {}
 ''');
 
@@ -770,7 +770,7 @@
 
   Future<void> test_withClass_pub_other_inLib_notListed() async {
     var aaaRoot = getFolder('$packagesRootPath/aaa');
-    newFile2('${aaaRoot.path}/lib/a.dart', '''
+    newFile('${aaaRoot.path}/lib/a.dart', '''
 class Test {}
 ''');
 
@@ -793,7 +793,7 @@
 
   Future<void> test_withClass_pub_other_inTest_dependencies() async {
     var aaaRoot = getFolder('$packagesRootPath/aaa');
-    newFile2('${aaaRoot.path}/lib/a.dart', '''
+    newFile('${aaaRoot.path}/lib/a.dart', '''
 class Test {}
 ''');
 
@@ -808,7 +808,7 @@
         ..add(name: 'aaa', rootPath: aaaRoot.path),
     );
 
-    var b = newFile2('$testPackageTestPath/b.dart', r'''
+    var b = newFile('$testPackageTestPath/b.dart', r'''
 void f(Test t) {}
 ''');
 
@@ -823,7 +823,7 @@
 
   Future<void> test_withClass_pub_other_inTest_devDependencies() async {
     var aaaRoot = getFolder('$packagesRootPath/aaa');
-    newFile2('${aaaRoot.path}/lib/a.dart', '''
+    newFile('${aaaRoot.path}/lib/a.dart', '''
 class Test {}
 ''');
 
@@ -838,7 +838,7 @@
         ..add(name: 'aaa', rootPath: aaaRoot.path),
     );
 
-    var b = newFile2('$testPackageTestPath/b.dart', r'''
+    var b = newFile('$testPackageTestPath/b.dart', r'''
 void f(Test t) {}
 ''');
 
@@ -856,7 +856,7 @@
 name: test
 ''');
 
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class Test {}
 ''');
 
@@ -876,7 +876,7 @@
 name: test
 ''');
 
-    newFile2('$testPackageTestPath/a.dart', r'''
+    newFile('$testPackageTestPath/a.dart', r'''
 class Test {}
 ''');
 
@@ -891,11 +891,11 @@
 name: test
 ''');
 
-    newFile2('$testPackageTestPath/a.dart', r'''
+    newFile('$testPackageTestPath/a.dart', r'''
 class Test {}
 ''');
 
-    var b = newFile2('$testPackageTestPath/b.dart', r'''
+    var b = newFile('$testPackageTestPath/b.dart', r'''
 void f(Test t) {}
 ''');
 
@@ -913,7 +913,7 @@
 name: test
 ''');
 
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension IntExtension on int {
   int get foo => 0;
 }
@@ -1225,10 +1225,10 @@
   FixKind get kind => DartFixKind.IMPORT_LIBRARY_PROJECT2;
 
   Future<void> test_lib() async {
-    newFile2('$packagesRootPath/my_pkg/lib/a.dart', '''
+    newFile('$packagesRootPath/my_pkg/lib/a.dart', '''
 export 'b.dart';
 ''');
-    newFile2('$packagesRootPath/my_pkg/lib/b.dart', '''
+    newFile('$packagesRootPath/my_pkg/lib/b.dart', '''
 class Test {}
 ''');
 
@@ -1258,10 +1258,10 @@
   }
 
   Future<void> test_lib_src() async {
-    newFile2('$packagesRootPath/my_pkg/lib/a.dart', '''
+    newFile('$packagesRootPath/my_pkg/lib/a.dart', '''
 export 'src/b.dart';
 ''');
-    newFile2('$packagesRootPath/my_pkg/lib/src/b.dart', '''
+    newFile('$packagesRootPath/my_pkg/lib/src/b.dart', '''
 class Test {}
 ''');
 
@@ -1291,10 +1291,10 @@
   }
 
   Future<void> test_lib_src_extension() async {
-    newFile2('$packagesRootPath/my_pkg/lib/a.dart', '''
+    newFile('$packagesRootPath/my_pkg/lib/a.dart', '''
 export 'src/b.dart';
 ''');
-    newFile2('$packagesRootPath/my_pkg/lib/src/b.dart', '''
+    newFile('$packagesRootPath/my_pkg/lib/src/b.dart', '''
 extension E on int {
   static String m() => '';
 }
@@ -1354,7 +1354,7 @@
 name: test
 ''');
 
-    newFile2('$testPackageLibPath/src/a.dart', r'''
+    newFile('$testPackageLibPath/src/a.dart', r'''
 class Test {}
 ''');
 
@@ -1374,11 +1374,11 @@
 name: test
 ''');
 
-    newFile2('$testPackageLibPath/src/a.dart', r'''
+    newFile('$testPackageLibPath/src/a.dart', r'''
 class Test {}
 ''');
 
-    var b = newFile2('$testPackageTestPath/b.dart', r'''
+    var b = newFile('$testPackageTestPath/b.dart', r'''
 void f(Test t) {}
 ''');
 
diff --git a/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart b/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart
index 770e2c0..8ac29b9 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/organize_imports_test.dart
@@ -42,12 +42,12 @@
   }
 
   Future<void> test_organizePathImports() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   static void m() {}
 }
 ''');
-    newFile2('$testPackageLibPath/a/b.dart', '''
+    newFile('$testPackageLibPath/a/b.dart', '''
 class B {
   static void m() {}
 }
diff --git a/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart b/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart
index 2f939e1..e316161 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/pubspec/test_support.dart
@@ -43,7 +43,7 @@
 
   void validatePubspec(String content) {
     this.content = content;
-    var pubspecFile = newFile2('/home/test/pubspec.yaml', content);
+    var pubspecFile = newFile('/home/test/pubspec.yaml', content);
     document = loadYamlDocument(content);
     var yamlContent = document.contents;
     if (yamlContent is! YamlMap) {
diff --git a/pkg/analysis_server/test/src/services/correction/fix/qualify_reference_test.dart b/pkg/analysis_server/test/src/services/correction/fix/qualify_reference_test.dart
index 6c3ee19..cb1646c 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/qualify_reference_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/qualify_reference_test.dart
@@ -43,7 +43,7 @@
   }
 
   Future<void> test_class_imported() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   static void m() {}
 }
@@ -60,7 +60,7 @@
   }
 
   Future<void> test_class_importedWithPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   static void m() {}
 }
@@ -104,12 +104,12 @@
   }
 
   Future<void> test_class_notImported() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   static void m() {}
 }
 ''');
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart';
 class B extends A {}
 ''');
@@ -148,7 +148,7 @@
   }
 
   Future<void> test_extension_imported() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   static void m() {}
 }
@@ -165,7 +165,7 @@
   }
 
   Future<void> test_extension_importedWithPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   static void m() {}
 }
@@ -209,12 +209,12 @@
   }
 
   Future<void> test_extension_notImported() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   static void m() {}
 }
 ''');
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart';
 class B extends A {}
 ''');
diff --git a/pkg/analysis_server/test/src/services/correction/fix/remove_method_declaration_test.dart b/pkg/analysis_server/test/src/services/correction/fix/remove_method_declaration_test.dart
index 319a8e9..ca211c5 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/remove_method_declaration_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/remove_method_declaration_test.dart
@@ -126,7 +126,7 @@
   @FailingTest(issue: 'https://github.com/dart-lang/linter/issues/1997')
   Future<void> test_method_nullSafety_optIn_fromOptOut() async {
     createAnalysisOptionsFile(lints: [lintCode]);
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo() => 0;
 }
diff --git a/pkg/analysis_server/test/src/services/correction/fix/replace_with_extension_name_test.dart b/pkg/analysis_server/test/src/services/correction/fix/replace_with_extension_name_test.dart
index 809b33f..e31a600 100644
--- a/pkg/analysis_server/test/src/services/correction/fix/replace_with_extension_name_test.dart
+++ b/pkg/analysis_server/test/src/services/correction/fix/replace_with_extension_name_test.dart
@@ -62,7 +62,7 @@
   }
 
   Future<void> test_qualified() async {
-    newFile2('$testPackageLibPath/ext.dart', '''
+    newFile('$testPackageLibPath/ext.dart', '''
 extension E on String {
   static int m() => 0;
 }
diff --git a/pkg/analyzer/CHANGELOG.md b/pkg/analyzer/CHANGELOG.md
index 3022ce6..c4be06d 100644
--- a/pkg/analyzer/CHANGELOG.md
+++ b/pkg/analyzer/CHANGELOG.md
@@ -1,5 +1,6 @@
 ## 4.1.0-dev
 * Deprecated `ParameterElement.isNotOptional`, use `isRequired` instead.
+* Deprecated `ResourceProviderMixin.newFile2`, use `newFile` instead.
 
 ## 4.0.0
 * Removed deprecated `UriKind` and `Source.uriKind`.
diff --git a/pkg/analyzer/lib/src/test_utilities/resource_provider_mixin.dart b/pkg/analyzer/lib/src/test_utilities/resource_provider_mixin.dart
index dadf358..9354875 100644
--- a/pkg/analyzer/lib/src/test_utilities/resource_provider_mixin.dart
+++ b/pkg/analyzer/lib/src/test_utilities/resource_provider_mixin.dart
@@ -71,19 +71,20 @@
 
   File newAnalysisOptionsYamlFile2(String directoryPath, String content) {
     String path = join(directoryPath, file_paths.analysisOptionsYaml);
-    return newFile2(path, content);
+    return newFile(path, content);
   }
 
   File newBazelBuildFile(String directoryPath, String content) {
     String path = join(directoryPath, file_paths.bazelBuild);
-    return newFile2(path, content);
+    return newFile(path, content);
   }
 
-  @Deprecated('Use newFile2() instead')
-  File newFile(String path, {String content = ''}) {
-    return newFile2(path, content);
+  File newFile(String path, String content) {
+    String convertedPath = convertPath(path);
+    return resourceProvider.newFile(convertedPath, content);
   }
 
+  @Deprecated('Use newFile() instead')
   File newFile2(String path, String content) {
     String convertedPath = convertPath(path);
     return resourceProvider.newFile(convertedPath, content);
@@ -100,12 +101,12 @@
       file_paths.dotDartTool,
       file_paths.packageConfigJson,
     );
-    return newFile2(path, content);
+    return newFile(path, content);
   }
 
   File newPubspecYamlFile(String directoryPath, String content) {
     String path = join(directoryPath, file_paths.pubspecYaml);
-    return newFile2(path, content);
+    return newFile(path, content);
   }
 
   Uri toUri(String path) {
diff --git a/pkg/analyzer/test/dart/analysis/analysis_context_test.dart b/pkg/analyzer/test/dart/analysis/analysis_context_test.dart
index 4ebf81d..e3796ef 100644
--- a/pkg/analyzer/test/dart/analysis/analysis_context_test.dart
+++ b/pkg/analyzer/test/dart/analysis/analysis_context_test.dart
@@ -16,13 +16,13 @@
 @reflectiveTest
 class AnalysisContextTest extends PubPackageResolutionTest {
   test_changeFile_imported() async {
-    var a = newFile2('$testPackageLibPath/a.dart', '');
+    var a = newFile('$testPackageLibPath/a.dart', '');
 
-    var b = newFile2('$testPackageLibPath/b.dart', r'''
+    var b = newFile('$testPackageLibPath/b.dart', r'''
 import 'a.dart';
 ''');
 
-    var c = newFile2('$testPackageLibPath/c.dart', '');
+    var c = newFile('$testPackageLibPath/c.dart', '');
 
     var analysisContext = contextFor(a.path);
 
@@ -41,19 +41,19 @@
   }
 
   test_changeFile_part() async {
-    var a = newFile2('$testPackageLibPath/a.dart', r'''
+    var a = newFile('$testPackageLibPath/a.dart', r'''
 part 'b.dart';
 ''');
 
-    var b = newFile2('$testPackageLibPath/b.dart', r'''
+    var b = newFile('$testPackageLibPath/b.dart', r'''
 part of 'a.dart';
 ''');
 
-    var c = newFile2('$testPackageLibPath/c.dart', r'''
+    var c = newFile('$testPackageLibPath/c.dart', r'''
 import 'a.dart';
 ''');
 
-    var d = newFile2('$testPackageLibPath/d.dart', '');
+    var d = newFile('$testPackageLibPath/d.dart', '');
 
     var analysisContext = contextFor(a.path);
 
diff --git a/pkg/analyzer/test/error/error_reporter_test.dart b/pkg/analyzer/test/error/error_reporter_test.dart
index 41d54bd..d83df43 100644
--- a/pkg/analyzer/test/error/error_reporter_test.dart
+++ b/pkg/analyzer/test/error/error_reporter_test.dart
@@ -73,8 +73,8 @@
   }
 
   test_reportErrorForNode_types_differentNames() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
-    newFile2('$testPackageLibPath/b.dart', 'class B {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/b.dart', 'class B {}');
     await resolveTestCode(r'''
 import 'package:test/a.dart';
 import 'package:test/b.dart';
@@ -112,8 +112,8 @@
   }
 
   test_reportErrorForNode_types_sameName() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
-    newFile2('$testPackageLibPath/b.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/b.dart', 'class A {}');
     await resolveTestCode(r'''
 import 'package:test/a.dart';
 import 'package:test/b.dart';
@@ -150,8 +150,8 @@
   }
 
   test_reportErrorForNode_types_sameName_functionType() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A{}');
-    newFile2('$testPackageLibPath/b.dart', 'class A{}');
+    newFile('$testPackageLibPath/a.dart', 'class A{}');
+    newFile('$testPackageLibPath/b.dart', 'class A{}');
     await resolveTestCode(r'''
 import 'a.dart' as a;
 import 'b.dart' as b;
@@ -184,8 +184,8 @@
   }
 
   test_reportErrorForNode_types_sameName_nested() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A{}');
-    newFile2('$testPackageLibPath/b.dart', 'class A{}');
+    newFile('$testPackageLibPath/a.dart', 'class A{}');
+    newFile('$testPackageLibPath/b.dart', 'class A{}');
     await resolveTestCode(r'''
 import 'a.dart' as a;
 import 'b.dart' as b;
diff --git a/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart b/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
index 3adf09b..edd14a8 100644
--- a/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
+++ b/pkg/analyzer/test/file_system/resource_uri_resolver_test.dart
@@ -19,7 +19,7 @@
 
   void setUp() {
     resolver = ResourceUriResolver(resourceProvider);
-    newFile2('/test.dart', '');
+    newFile('/test.dart', '');
     newFolder('/folder');
   }
 
diff --git a/pkg/analyzer/test/generated/all_the_rest_test.dart b/pkg/analyzer/test/generated/all_the_rest_test.dart
index fa2e7de..3c1d9bc 100644
--- a/pkg/analyzer/test/generated/all_the_rest_test.dart
+++ b/pkg/analyzer/test/generated/all_the_rest_test.dart
@@ -178,18 +178,18 @@
   late final DartSdk sdk;
 
   void setUp() {
-    newFile2('/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart', '''
+    newFile('/sdk/lib/_internal/sdk_library_metadata/lib/libraries.dart', '''
 const Map<String, LibraryInfo> libraries = const {
   "core": const LibraryInfo("core/core.dart")
 };
 ''');
 
-    newFile2('/sdk/lib/core/core.dart', '''
+    newFile('/sdk/lib/core/core.dart', '''
 library dart.core;
 part 'int.dart';
 ''');
 
-    newFile2('/sdk/lib/core/int.dart', '''
+    newFile('/sdk/lib/core/int.dart', '''
 part of dart.core;
 ''');
 
diff --git a/pkg/analyzer/test/generated/element_resolver_test.dart b/pkg/analyzer/test/generated/element_resolver_test.dart
index 9cd13b7..7cac99c 100644
--- a/pkg/analyzer/test/generated/element_resolver_test.dart
+++ b/pkg/analyzer/test/generated/element_resolver_test.dart
@@ -21,7 +21,7 @@
 @reflectiveTest
 class AnnotationElementResolverTest extends PubPackageResolutionTest {
   test_class_namedConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A.named();
 }
@@ -46,7 +46,7 @@
   }
 
   test_class_prefixed_namedConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A.named();
 }
@@ -72,7 +72,7 @@
   }
 
   test_class_prefixed_staticConstField() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static const V = 0;
 }
@@ -97,7 +97,7 @@
   }
 
   test_class_prefixed_unnamedConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A();
 }
@@ -121,7 +121,7 @@
   }
 
   test_class_staticConstField() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static const V = 0;
 }
@@ -145,7 +145,7 @@
   }
 
   test_class_unnamedConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A();
 }
@@ -168,7 +168,7 @@
   }
 
   test_topLevelVariable() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const V = 0;
 ''');
     await _validateAnnotation('', '@V',
@@ -189,7 +189,7 @@
   }
 
   test_topLevelVariable_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const V = 0;
 ''');
     await _validateAnnotation('as p', '@p.V',
@@ -437,7 +437,7 @@
   }
 
   test_visitImportDirective_withCombinators() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 int v1 = 0;
 final int v2 = 0;
 ''');
diff --git a/pkg/analyzer/test/generated/invalid_code_test.dart b/pkg/analyzer/test/generated/invalid_code_test.dart
index 96e8861..1e701bb 100644
--- a/pkg/analyzer/test/generated/invalid_code_test.dart
+++ b/pkg/analyzer/test/generated/invalid_code_test.dart
@@ -61,7 +61,7 @@
   }
 
   test_methodInvocation_ofGenericClass_generic_static_fromLegacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   static void foo<T2>() {}
 }
@@ -162,7 +162,7 @@
   }
 
   test_extensionOverrideInAnnotationContext_importedWithPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E on Object {
   int f() => 0;
 }
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index d06a00c..e0fb10a 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -138,7 +138,7 @@
   }
 
   test_typedef_not_function() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 typedef F = int;
 ''');
     await assertNoErrorsInCode('''
@@ -150,11 +150,11 @@
 
 mixin NonErrorResolverTestCases on PubPackageResolutionTest {
   test_ambiguousExport() async {
-    newFile2("$testPackageLibPath/lib1.dart", r'''
+    newFile("$testPackageLibPath/lib1.dart", r'''
 library lib1;
 class M {}
 ''');
-    newFile2("$testPackageLibPath/lib2.dart", r'''
+    newFile("$testPackageLibPath/lib2.dart", r'''
 library lib2;
 class N {}
 ''');
@@ -166,12 +166,12 @@
   }
 
   test_ambiguousExport_combinators_hide() async {
-    newFile2("$testPackageLibPath/lib1.dart", r'''
+    newFile("$testPackageLibPath/lib1.dart", r'''
 library L1;
 class A {}
 class B {}
 ''');
-    newFile2("$testPackageLibPath/lib2.dart", r'''
+    newFile("$testPackageLibPath/lib2.dart", r'''
 library L2;
 class B {}
 class C {}
@@ -184,12 +184,12 @@
   }
 
   test_ambiguousExport_combinators_show() async {
-    newFile2("$testPackageLibPath/lib1.dart", r'''
+    newFile("$testPackageLibPath/lib1.dart", r'''
 library L1;
 class A {}
 class B {}
 ''');
-    newFile2("$testPackageLibPath/lib2.dart", r'''
+    newFile("$testPackageLibPath/lib2.dart", r'''
 library L2;
 class B {}
 class C {}
@@ -202,7 +202,7 @@
   }
 
   test_ambiguousExport_sameDeclaration() async {
-    newFile2("$testPackageLibPath/lib.dart", r'''
+    newFile("$testPackageLibPath/lib.dart", r'''
 library lib;
 class N {}
 ''');
@@ -214,7 +214,7 @@
   }
 
   test_ambiguousImport_dart_implicitHide() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 class Future {
   static const zero = 0;
 }
@@ -228,17 +228,17 @@
   }
 
   test_ambiguousImport_hideCombinator() async {
-    newFile2("$testPackageLibPath/lib1.dart", r'''
+    newFile("$testPackageLibPath/lib1.dart", r'''
 library lib1;
 class N {}
 class N1 {}
 ''');
-    newFile2("$testPackageLibPath/lib2.dart", r'''
+    newFile("$testPackageLibPath/lib2.dart", r'''
 library lib2;
 class N {}
 class N2 {}
 ''');
-    newFile2("$testPackageLibPath/lib3.dart", r'''
+    newFile("$testPackageLibPath/lib3.dart", r'''
 library lib3;
 class N {}
 class N3 {}
@@ -256,12 +256,12 @@
   }
 
   test_ambiguousImport_showCombinator() async {
-    newFile2("$testPackageLibPath/lib1.dart", r'''
+    newFile("$testPackageLibPath/lib1.dart", r'''
 library lib1;
 class N {}
 class N1 {}
 ''');
-    newFile2("$testPackageLibPath/lib2.dart", r'''
+    newFile("$testPackageLibPath/lib2.dart", r'''
 library lib2;
 class N {}
 class N2 {}
@@ -279,7 +279,7 @@
   }
 
   test_annotated_partOfDeclaration() async {
-    newFile2('$testPackageLibPath/part.dart', '''
+    newFile('$testPackageLibPath/part.dart', '''
 @deprecated part of L;
 ''');
     await assertNoErrorsInCode('''
@@ -505,7 +505,7 @@
   }
 
   test_assignmentToFinals_importWithPrefix() async {
-    newFile2("$testPackageLibPath/lib1.dart", r'''
+    newFile("$testPackageLibPath/lib1.dart", r'''
 library lib1;
 bool x = false;''');
     await assertNoErrorsInCode(r'''
@@ -773,7 +773,7 @@
   }
 
   test_closure_in_type_inferred_variable_in_other_lib() async {
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 var y = (Object x) => x is int && x.isEven;
 ''');
     await assertNoErrorsInCode('''
@@ -817,13 +817,13 @@
   }
 
   test_const_imported_defaultParameterValue_withImportPrefix() async {
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 import 'c.dart' as ccc;
 class B {
   const B([p = ccc.value]);
 }
 ''');
-    newFile2('$testPackageLibPath/c.dart', r'''
+    newFile('$testPackageLibPath/c.dart', r'''
 const int value = 12345;
 ''');
     await assertNoErrorsInCode(r'''
@@ -900,7 +900,7 @@
   }
 
   test_constDeferredClass_new() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 class A {
   const A.b();
 }
@@ -921,7 +921,7 @@
   }
 
   test_constEval_propertyExtraction_fieldStatic_targetType() async {
-    newFile2("$testPackageLibPath/math.dart", r'''
+    newFile("$testPackageLibPath/math.dart", r'''
 library math;
 const PI = 3.14;
 ''');
@@ -942,7 +942,7 @@
   }
 
   test_constEval_symbol() async {
-    newFile2("$testPackageLibPath/math.dart", r'''
+    newFile("$testPackageLibPath/math.dart", r'''
 library math;
 const PI = 3.14;
 ''');
@@ -1117,7 +1117,7 @@
   }
 
   test_deprecatedMemberUse_hide() async {
-    newFile2("$testPackageLibPath/lib1.dart", r'''
+    newFile("$testPackageLibPath/lib1.dart", r'''
 library lib1;
 class A {}
 @deprecated
@@ -1626,7 +1626,7 @@
   }
 
   test_importDuplicatedLibraryName() async {
-    newFile2("$testPackageLibPath/lib.dart", "library lib;");
+    newFile("$testPackageLibPath/lib.dart", "library lib;");
     await assertErrorsInCode(r'''
 library test;
 import 'lib.dart';
@@ -1639,8 +1639,8 @@
   }
 
   test_importDuplicatedLibraryUnnamed() async {
-    newFile2("$testPackageLibPath/lib1.dart", '');
-    newFile2("$testPackageLibPath/lib2.dart", '');
+    newFile("$testPackageLibPath/lib1.dart", '');
+    newFile("$testPackageLibPath/lib2.dart", '');
     // No warning on duplicate import (https://github.com/dart-lang/sdk/issues/24156)
     await assertErrorsInCode(r'''
 library test;
@@ -1653,7 +1653,7 @@
   }
 
   test_importOfNonLibrary_libraryDeclared() async {
-    newFile2("$testPackageLibPath/part.dart", r'''
+    newFile("$testPackageLibPath/part.dart", r'''
 library lib1;
 class A {}
 ''');
@@ -1665,7 +1665,7 @@
   }
 
   test_importOfNonLibrary_libraryNotDeclared() async {
-    newFile2("$testPackageLibPath/part.dart", '''
+    newFile("$testPackageLibPath/part.dart", '''
 class A {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -1676,11 +1676,11 @@
   }
 
   test_importPrefixes_withFirstLetterDifference() async {
-    newFile2("$testPackageLibPath/lib1.dart", r'''
+    newFile("$testPackageLibPath/lib1.dart", r'''
 library lib1;
 test1() {}
 ''');
-    newFile2("$testPackageLibPath/lib2.dart", r'''
+    newFile("$testPackageLibPath/lib2.dart", r'''
 library lib2;
 test2() {}
 ''');
@@ -1846,7 +1846,7 @@
   }
 
   test_instanceMethodNameCollidesWithSuperclassStatic_field() async {
-    newFile2("$testPackageLibPath/lib.dart", r'''
+    newFile("$testPackageLibPath/lib.dart", r'''
 library L;
 class A {
   static var _m;
@@ -1863,7 +1863,7 @@
   }
 
   test_instanceMethodNameCollidesWithSuperclassStatic_method() async {
-    newFile2("$testPackageLibPath/lib.dart", r'''
+    newFile("$testPackageLibPath/lib.dart", r'''
 library L;
 class A {
   static _m() {}
@@ -1937,7 +1937,7 @@
   }
 
   test_invalidAnnotation_constantVariable_field_importWithPrefix() async {
-    newFile2("$testPackageLibPath/lib.dart", r'''
+    newFile("$testPackageLibPath/lib.dart", r'''
 library lib;
 class A {
   static const C = 0;
@@ -1961,7 +1961,7 @@
   }
 
   test_invalidAnnotation_constantVariable_topLevel_importWithPrefix() async {
-    newFile2("$testPackageLibPath/lib.dart", r'''
+    newFile("$testPackageLibPath/lib.dart", r'''
 library lib;
 const C = 0;
 ''');
@@ -1974,7 +1974,7 @@
   }
 
   test_invalidAnnotation_constConstructor_importWithPrefix() async {
-    newFile2("$testPackageLibPath/lib.dart", r'''
+    newFile("$testPackageLibPath/lib.dart", r'''
 library lib;
 class A {
   const A(int p);
@@ -1989,7 +1989,7 @@
   }
 
   test_invalidAnnotation_constConstructor_named_importWithPrefix() async {
-    newFile2("$testPackageLibPath/lib.dart", r'''
+    newFile("$testPackageLibPath/lib.dart", r'''
 library lib;
 class A {
   const A.named(int p);
@@ -2166,12 +2166,12 @@
   }
 
   Future test_issue32114() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class O {}
 
 typedef T Func<T extends O>(T e);
 ''');
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart';
 export 'a.dart' show Func;
 
@@ -2219,7 +2219,7 @@
   }
 
   test_issue_35320_lists() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 const x = const <String>['a'];
 ''');
     await assertNoErrorsInCode('''
@@ -2239,7 +2239,7 @@
   }
 
   test_issue_35320_maps() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 const x = const <String, String>{'a': 'b'};
 ''');
     await assertNoErrorsInCode('''
@@ -2259,7 +2259,7 @@
   }
 
   test_loadLibraryDefined() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 library lib;
 foo() => 22;''');
     await assertNoErrorsInCode(r'''
@@ -2813,13 +2813,13 @@
   }
 
   test_optionalNew_rewrite() async {
-    newFile2("$testPackageLibPath/a.dart", r'''
+    newFile("$testPackageLibPath/a.dart", r'''
 class A {
   const A();
   const A.named();
 }
 ''');
-    newFile2("$testPackageLibPath/b.dart", r'''
+    newFile("$testPackageLibPath/b.dart", r'''
 import 'a.dart';
 import 'a.dart' as p;
 
@@ -2849,7 +2849,7 @@
   }
 
   test_optionalNew_rewrite_instantiatesToBounds() async {
-    newFile2("$testPackageLibPath/a.dart", r'''
+    newFile("$testPackageLibPath/a.dart", r'''
 class Unbounded<T> {
   const Unbounded();
   const Unbounded.named();
@@ -2859,7 +2859,7 @@
   const Bounded.named();
 }
 ''');
-    newFile2("$testPackageLibPath/b.dart", r'''
+    newFile("$testPackageLibPath/b.dart", r'''
 import 'a.dart';
 import 'a.dart' as p;
 
@@ -3050,13 +3050,13 @@
   }
 
   test_sharedDeferredPrefix() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 f1() {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 f2() {}
 ''');
-    newFile2('$testPackageLibPath/lib3.dart', r'''
+    newFile('$testPackageLibPath/lib3.dart', r'''
 f3() {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -3237,7 +3237,7 @@
   }
 
   test_typeType_class_prefixed() async {
-    newFile2("$testPackageLibPath/lib.dart", r'''
+    newFile("$testPackageLibPath/lib.dart", r'''
 library lib;
 class C {}''');
     await assertNoErrorsInCode(r'''
@@ -3260,7 +3260,7 @@
   }
 
   test_typeType_functionTypeAlias_prefixed() async {
-    newFile2("$testPackageLibPath/lib.dart", r'''
+    newFile("$testPackageLibPath/lib.dart", r'''
 library lib;
 typedef F();''');
     await assertNoErrorsInCode(r'''
diff --git a/pkg/analyzer/test/generated/non_hint_code_test.dart b/pkg/analyzer/test/generated/non_hint_code_test.dart
index 17cf69b..d01918d 100644
--- a/pkg/analyzer/test/generated/non_hint_code_test.dart
+++ b/pkg/analyzer/test/generated/non_hint_code_test.dart
@@ -235,8 +235,8 @@
   }
 
   test_import_referenceIntoLibDirectory() async {
-    newFile2("/myproj/pubspec.yaml", '');
-    newFile2("/myproj/lib/other.dart", '');
+    newFile("/myproj/pubspec.yaml", '');
+    newFile("/myproj/lib/other.dart", '');
     await _assertErrorsInCodeInFile(
         "/myproj/web/test.dart", "import '../lib/other.dart';", [
       error(HintCode.FILE_IMPORT_OUTSIDE_LIB_REFERENCES_FILE_INSIDE, 0, 0),
@@ -244,14 +244,14 @@
   }
 
   test_import_referenceIntoLibDirectory_no_pubspec() async {
-    newFile2("/myproj/lib/other.dart", '');
+    newFile("/myproj/lib/other.dart", '');
     await _assertErrorsInCodeInFile(
         "/myproj/web/test.dart", "import '../lib/other.dart';", []);
   }
 
   test_import_referenceOutOfLibDirectory() async {
-    newFile2("/myproj/pubspec.yaml", '');
-    newFile2("/myproj/web/other.dart", '');
+    newFile("/myproj/pubspec.yaml", '');
+    newFile("/myproj/web/other.dart", '');
     await _assertErrorsInCodeInFile(
         "/myproj/lib/test.dart", "import '../web/other.dart';", [
       error(HintCode.FILE_IMPORT_INSIDE_LIB_REFERENCES_FILE_OUTSIDE, 0, 0),
@@ -259,28 +259,28 @@
   }
 
   test_import_referenceOutOfLibDirectory_no_pubspec() async {
-    newFile2("/myproj/web/other.dart", '');
+    newFile("/myproj/web/other.dart", '');
     await _assertErrorsInCodeInFile(
         "/myproj/lib/test.dart", "import '../web/other.dart';", []);
   }
 
   test_import_valid_inside_lib1() async {
-    newFile2("/myproj/pubspec.yaml", '');
-    newFile2("/myproj/lib/other.dart", '');
+    newFile("/myproj/pubspec.yaml", '');
+    newFile("/myproj/lib/other.dart", '');
     await _assertErrorsInCodeInFile(
         "/myproj/lib/test.dart", "import 'other.dart';", []);
   }
 
   test_import_valid_inside_lib2() async {
-    newFile2("/myproj/pubspec.yaml", '');
-    newFile2("/myproj/lib/bar/other.dart", '');
+    newFile("/myproj/pubspec.yaml", '');
+    newFile("/myproj/lib/bar/other.dart", '');
     await _assertErrorsInCodeInFile(
         "/myproj/lib/foo/test.dart", "import '../bar/other.dart';", []);
   }
 
   test_import_valid_outside_lib() async {
-    newFile2("/myproj/pubspec.yaml", '');
-    newFile2("/myproj/web/other.dart", '');
+    newFile("/myproj/pubspec.yaml", '');
+    newFile("/myproj/web/other.dart", '');
     await _assertErrorsInCodeInFile(
         "/myproj/lib2/test.dart", "import '../web/other.dart';", []);
   }
@@ -288,7 +288,7 @@
   Future<void> _assertErrorsInCodeInFile(
       String path, String content, List<ExpectedError> expectedErrors) async {
     path = convertPath(path);
-    newFile2(path, content);
+    newFile(path, content);
     result = await resolveFile(path);
 
     var errorListener = GatheringErrorListener();
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index e5232e6..1ccc8bb 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -528,7 +528,7 @@
   }
 
   test_invocation_target_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int max(int x, int y) => 0;
 ''');
     await resolveTestCode('''
@@ -591,7 +591,7 @@
   }
 
   test_objectAccessInference_disabled_for_library_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 dynamic get hashCode => 42;
 ''');
     await assertNoErrorsInCode('''
@@ -612,7 +612,7 @@
   }
 
   test_objectMethodInference_disabled_for_library_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 dynamic toString = (int x) => x + 42;
 ''');
     await assertNoErrorsInCode('''
diff --git a/pkg/analyzer/test/generated/simple_resolver_test.dart b/pkg/analyzer/test/generated/simple_resolver_test.dart
index d4cedc5..e26ff8a 100644
--- a/pkg/analyzer/test/generated/simple_resolver_test.dart
+++ b/pkg/analyzer/test/generated/simple_resolver_test.dart
@@ -422,7 +422,7 @@
   }
 
   test_entryPoint_exported() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 main() {}
 ''');
 
@@ -457,7 +457,7 @@
   }
 
   test_enum_externalLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 enum EEE {A, B, C}
 ''');
     await assertNoErrorsInCode(r'''
@@ -590,11 +590,11 @@
   }
 
   test_import_hide() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 set foo(value) {}
 class A {}''');
 
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 set foo(value) {}''');
 
     await assertNoErrorsInCode(r'''
@@ -609,7 +609,7 @@
   }
 
   test_import_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 f(int x) {
   return x * x;
 }''');
@@ -678,7 +678,7 @@
   }
 
   test_import_spaceInUri() async {
-    newFile2('$testPackageLibPath/sub folder/a.dart', r'''
+    newFile('$testPackageLibPath/sub folder/a.dart', r'''
 foo() {}''');
 
     await assertNoErrorsInCode(r'''
diff --git a/pkg/analyzer/test/source/analysis_options_provider_test.dart b/pkg/analyzer/test/source/analysis_options_provider_test.dart
index cb2db31..0666197 100644
--- a/pkg/analyzer/test/source/analysis_options_provider_test.dart
+++ b/pkg/analyzer/test/source/analysis_options_provider_test.dart
@@ -101,12 +101,12 @@
 
   void test_getOptions_crawlUp_hasInFolder() {
     newFolder('/foo/bar');
-    newFile2('/foo/$analysisOptionsYaml', r'''
+    newFile('/foo/$analysisOptionsYaml', r'''
 analyzer:
   ignore:
     - foo
 ''');
-    newFile2('/foo/bar/$analysisOptionsYaml', r'''
+    newFile('/foo/bar/$analysisOptionsYaml', r'''
 analyzer:
   ignore:
     - bar
@@ -122,12 +122,12 @@
 
   void test_getOptions_crawlUp_hasInParent() {
     newFolder('/foo/bar/baz');
-    newFile2('/foo/$analysisOptionsYaml', r'''
+    newFile('/foo/$analysisOptionsYaml', r'''
 analyzer:
   ignore:
     - foo
 ''');
-    newFile2('/foo/bar/$analysisOptionsYaml', r'''
+    newFile('/foo/bar/$analysisOptionsYaml', r'''
 analyzer:
   ignore:
     - bar
@@ -148,20 +148,20 @@
   }
 
   void test_getOptions_empty() {
-    newFile2('/$analysisOptionsYaml', r'''#empty''');
+    newFile('/$analysisOptionsYaml', r'''#empty''');
     YamlMap options = _getOptions('/');
     expect(options, isNotNull);
     expect(options, isEmpty);
   }
 
   void test_getOptions_include() {
-    newFile2('/foo.include', r'''
+    newFile('/foo.include', r'''
 analyzer:
   ignore:
     - ignoreme.dart
     - 'sdk_ext/**'
 ''');
-    newFile2('/$analysisOptionsYaml', r'''
+    newFile('/$analysisOptionsYaml', r'''
 include: foo.include
 ''');
     YamlMap options = _getOptions('/');
@@ -179,12 +179,12 @@
   }
 
   void test_getOptions_include_emptyLints() {
-    newFile2('/foo.include', r'''
+    newFile('/foo.include', r'''
 linter:
   rules:
     - prefer_single_quotes
 ''');
-    newFile2('/$analysisOptionsYaml', r'''
+    newFile('/$analysisOptionsYaml', r'''
 include: foo.include
 linter:
   rules:
@@ -204,7 +204,7 @@
   }
 
   void test_getOptions_include_missing() {
-    newFile2('/$analysisOptionsYaml', r'''
+    newFile('/$analysisOptionsYaml', r'''
 include: /foo.include
 ''');
     YamlMap options = _getOptions('/');
@@ -212,13 +212,13 @@
   }
 
   void test_getOptions_invalid() {
-    newFile2('/$analysisOptionsYaml', r''':''');
+    newFile('/$analysisOptionsYaml', r''':''');
     YamlMap options = _getOptions('/');
     expect(options, hasLength(1));
   }
 
   void test_getOptions_simple() {
-    newFile2('/$analysisOptionsYaml', r'''
+    newFile('/$analysisOptionsYaml', r'''
 analyzer:
   ignore:
     - ignoreme.dart
diff --git a/pkg/analyzer/test/src/context/package_config_json_test.dart b/pkg/analyzer/test/src/context/package_config_json_test.dart
index b1090fd..3f2061d 100644
--- a/pkg/analyzer/test/src/context/package_config_json_test.dart
+++ b/pkg/analyzer/test/src/context/package_config_json_test.dart
@@ -24,7 +24,7 @@
   }
 
   void setUp() {
-    newFile2('/test/lib/test.dart', '');
+    newFile('/test/lib/test.dart', '');
   }
 
   test_configVersion_2() {
@@ -301,7 +301,7 @@
 
   PackageConfigJson _parse(String content) {
     var path = '/test/.dart_tool/package_config.json';
-    newFile2(path, content);
+    newFile(path, content);
 
     var uri = toUri(path);
     return parsePackageConfigJson(uri, content);
diff --git a/pkg/analyzer/test/src/context/packages_test.dart b/pkg/analyzer/test/src/context/packages_test.dart
index a4e359a6..01c0cf3 100644
--- a/pkg/analyzer/test/src/context/packages_test.dart
+++ b/pkg/analyzer/test/src/context/packages_test.dart
@@ -17,7 +17,7 @@
 @reflectiveTest
 class PackagesTest with ResourceProviderMixin {
   void setUp() {
-    newFile2('/test/lib/test.dart', '');
+    newFile('/test/lib/test.dart', '');
   }
 
   void test_findPackagesFrom_missing() {
@@ -66,7 +66,7 @@
   }
 
   test_parsePackageConfigJsonFile() {
-    var file = newFile2('/test/.dart_tool/package_config.json', '''
+    var file = newFile('/test/.dart_tool/package_config.json', '''
 {
   "configVersion": 2,
   "packages": [
@@ -116,7 +116,7 @@
 
   test_parsePackagesFile_packageConfig() {
     var path = convertPath('/test/.dart_tool/package_config.json');
-    newFile2(path, '''
+    newFile(path, '''
 {
   "configVersion": 2,
   "packages": [
diff --git a/pkg/analyzer/test/src/dart/analysis/analysis_context_collection_test.dart b/pkg/analyzer/test/src/dart/analysis/analysis_context_collection_test.dart
index 2ff4f6d..68e87f8 100644
--- a/pkg/analyzer/test/src/dart/analysis/analysis_context_collection_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/analysis_context_collection_test.dart
@@ -57,7 +57,7 @@
   test_new_analysisOptions_includes() {
     var rootFolder = newFolder('/home/test');
     var fooFolder = newFolder('/home/packages/foo');
-    newFile2('${fooFolder.path}/lib/included.yaml', r'''
+    newFile('${fooFolder.path}/lib/included.yaml', r'''
 linter:
   rules:
     - empty_statements
@@ -124,11 +124,11 @@
 
   test_new_outer_inner() {
     var outerFolder = newFolder('/test/outer');
-    newFile2('/test/outer/lib/outer.dart', '');
+    newFile('/test/outer/lib/outer.dart', '');
 
     var innerFolder = newFolder('/test/outer/inner');
     newAnalysisOptionsYamlFile2('/test/outer/inner', '');
-    newFile2('/test/outer/inner/inner.dart', '');
+    newFile('/test/outer/inner/inner.dart', '');
 
     var collection = _newCollection(includedPaths: [outerFolder.path]);
 
diff --git a/pkg/analyzer/test/src/dart/analysis/base.dart b/pkg/analyzer/test/src/dart/analysis/base.dart
index b5bbf7d..fa0b08f 100644
--- a/pkg/analyzer/test/src/dart/analysis/base.dart
+++ b/pkg/analyzer/test/src/dart/analysis/base.dart
@@ -42,7 +42,7 @@
 
   void addTestFile(String content, {bool priority = false}) {
     testCode = content;
-    newFile2(testFile, content);
+    newFile(testFile, content);
     driver.addFile(testFile);
     if (priority) {
       driver.priorityFiles = [testFile];
diff --git a/pkg/analyzer/test/src/dart/analysis/context_builder_test.dart b/pkg/analyzer/test/src/dart/analysis/context_builder_test.dart
index dc50e76..a347cb8 100644
--- a/pkg/analyzer/test/src/dart/analysis/context_builder_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/context_builder_test.dart
@@ -98,7 +98,7 @@
 
   void test_analysisOptions_sdkVersionConstraint_noPubspec() {
     var projectPath = convertPath('/home/test');
-    newFile2('$projectPath/lib/a.dart', '');
+    newFile('$projectPath/lib/a.dart', '');
 
     var analysisContext = _createSingleAnalysisContext(projectPath);
     var analysisOptions = analysisContext.driver.analysisOptions;
@@ -167,7 +167,7 @@
 
   void test_sourceFactory_bazelWorkspace() {
     var projectPath = convertPath('/workspace/my/module');
-    newFile2('/workspace/WORKSPACE', '');
+    newFile('/workspace/WORKSPACE', '');
     newFolder('/workspace/bazel-bin');
     newFolder('/workspace/bazel-genfiles');
 
@@ -186,7 +186,7 @@
 
   void test_sourceFactory_pubWorkspace() {
     var projectPath = convertPath('/home/my');
-    newFile2('/home/my/pubspec.yaml', '');
+    newFile('/home/my/pubspec.yaml', '');
 
     var analysisContext = _createSingleAnalysisContext(projectPath);
     expect(analysisContext.contextRoot.workspace, isA<PubWorkspace>());
diff --git a/pkg/analyzer/test/src/dart/analysis/context_locator_test.dart b/pkg/analyzer/test/src/dart/analysis/context_locator_test.dart
index 36f385f..d9ca738 100644
--- a/pkg/analyzer/test/src/dart/analysis/context_locator_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/context_locator_test.dart
@@ -48,8 +48,8 @@
 
   void test_locateRoots_link_file_toOutOfRoot() {
     Folder rootFolder = newFolder('/home/test');
-    newFile2('/home/test/lib/a.dart', '');
-    newFile2('/home/b.dart', '');
+    newFile('/home/test/lib/a.dart', '');
+    newFile('/home/b.dart', '');
     resourceProvider.newLink(
       convertPath('/home/test/lib/c.dart'),
       convertPath('/home/b.dart'),
@@ -73,7 +73,7 @@
 
   void test_locateRoots_link_file_toSiblingInRoot() {
     Folder rootFolder = newFolder('/test');
-    newFile2('/test/lib/a.dart', '');
+    newFile('/test/lib/a.dart', '');
     resourceProvider.newLink(
       convertPath('/test/lib/b.dart'),
       convertPath('/test/lib/a.dart'),
@@ -97,7 +97,7 @@
 
   void test_locateRoots_link_folder_notExistingTarget() {
     var rootFolder = newFolder('/test');
-    newFile2('/test/lib/a.dart', '');
+    newFile('/test/lib/a.dart', '');
     newFolder('/test/lib/foo');
     resourceProvider.newLink(
       convertPath('/test/lib/foo'),
@@ -127,7 +127,7 @@
 
   void test_locateRoots_link_folder_toParentInRoot() {
     Folder rootFolder = newFolder('/test');
-    newFile2('/test/lib/a.dart', '');
+    newFile('/test/lib/a.dart', '');
     resourceProvider.newLink(
       convertPath('/test/lib/foo'),
       convertPath('/test/lib'),
@@ -153,9 +153,9 @@
 
   void test_locateRoots_link_folder_toParentOfRoot() {
     Folder rootFolder = newFolder('/home/test');
-    newFile2('/home/test/lib/a.dart', '');
-    newFile2('/home/b.dart', '');
-    newFile2('/home/other/c.dart', '');
+    newFile('/home/test/lib/a.dart', '');
+    newFile('/home/b.dart', '');
+    newFile('/home/other/c.dart', '');
     resourceProvider.newLink(
       convertPath('/home/test/lib/foo'),
       convertPath('/home'),
@@ -182,8 +182,8 @@
 
   void test_locateRoots_link_folder_toSiblingInRoot() {
     Folder rootFolder = newFolder('/test');
-    newFile2('/test/lib/a.dart', '');
-    newFile2('/test/lib/foo/b.dart', '');
+    newFile('/test/lib/a.dart', '');
+    newFile('/test/lib/foo/b.dart', '');
     resourceProvider.newLink(
       convertPath('/test/lib/bar'),
       convertPath('/test/lib/foo'),
@@ -299,9 +299,9 @@
     - lib/f*.dart
 ''');
     var packagesFile = newPackageConfigJsonFile(rootPath, '');
-    var fooFile = newFile2('$rootPath/lib/foo.dart', '');
-    newFile2('$rootPath/lib/far.dart', ''); // not used
-    var barFile = newFile2('$rootPath/lib/bar.dart', '');
+    var fooFile = newFile('$rootPath/lib/foo.dart', '');
+    newFile('$rootPath/lib/far.dart', ''); // not used
+    var barFile = newFile('$rootPath/lib/bar.dart', '');
 
     var roots = contextLocator.locateRoots(
       includedPaths: [rootFolder.path, fooFile.path],
@@ -322,7 +322,7 @@
 
   void test_locateRoots_multiple_dirAndNestedFile_noConfigurationFiles() {
     Folder outerRootFolder = newFolder('/test/outer');
-    File testFile = newFile2('/test/outer/examples/inner/test.dart', '');
+    File testFile = newFile('/test/outer/examples/inner/test.dart', '');
 
     List<ContextRoot> roots = contextLocator
         .locateRoots(includedPaths: [outerRootFolder.path, testFile.path]);
@@ -339,7 +339,7 @@
     Folder outerRootFolder = newFolder('/test/outer');
     File outerOptionsFile = newAnalysisOptionsYamlFile2('/test/outer', '');
     File outerPackagesFile = newPackageConfigJsonFile('/test/outer', '');
-    File testFile = newFile2('/test/outer/examples/inner/test.dart', '');
+    File testFile = newFile('/test/outer/examples/inner/test.dart', '');
 
     List<ContextRoot> roots = contextLocator
         .locateRoots(includedPaths: [outerRootFolder.path, testFile.path]);
@@ -406,7 +406,7 @@
 
     File outer2OptionsFile = newAnalysisOptionsYamlFile2('/test/outer2', '');
     File outer2PackagesFile = newPackageConfigJsonFile('/test/outer2', '');
-    File testFile = newFile2('/test/outer2/test.dart', '');
+    File testFile = newFile('/test/outer2/test.dart', '');
 
     List<ContextRoot> roots = contextLocator
         .locateRoots(includedPaths: [outer1RootFolder.path, testFile.path]);
@@ -427,7 +427,7 @@
 
   void test_locateRoots_multiple_dirAndSiblingFile_noConfigurationFiles() {
     Folder outer1RootFolder = newFolder('/test/outer1');
-    File testFile = newFile2('/test/outer2/test.dart', '');
+    File testFile = newFile('/test/outer2/test.dart', '');
 
     List<ContextRoot> roots = contextLocator
         .locateRoots(includedPaths: [outer1RootFolder.path, testFile.path]);
@@ -452,15 +452,15 @@
     var pkgPath1 = '$workspacePath1/pkg1';
     var pkgPath2 = '$workspacePath2/pkg2';
 
-    newFile2('$workspacePath1/WORKSPACE', '');
-    newFile2('$workspacePath2/WORKSPACE', '');
+    newFile('$workspacePath1/WORKSPACE', '');
+    newFile('$workspacePath2/WORKSPACE', '');
     newBazelBuildFile(pkgPath1, '');
     newBazelBuildFile(pkgPath2, '');
 
     var folder1 = newFolder('$pkgPath1/lib/folder1');
     var folder2 = newFolder('$pkgPath2/lib/folder2');
-    var file1 = newFile2('$pkgPath1/lib/folder1/file1.dart', '');
-    var file2 = newFile2('$pkgPath2/lib/folder2/file2.dart', '');
+    var file1 = newFile('$pkgPath1/lib/folder1/file1.dart', '');
+    var file2 = newFile('$pkgPath2/lib/folder2/file2.dart', '');
 
     var roots = contextLocator.locateRoots(
       includedPaths: [folder1.path, folder2.path],
@@ -493,8 +493,8 @@
     - lib/test2.dart
 ''');
     File packagesFile = newPackageConfigJsonFile('/home/test', '');
-    File testFile1 = newFile2('/home/test/lib/test1.dart', '');
-    File testFile2 = newFile2('/home/test/lib/test2.dart', '');
+    File testFile1 = newFile('/home/test/lib/test1.dart', '');
+    File testFile2 = newFile('/home/test/lib/test2.dart', '');
 
     List<ContextRoot> roots = contextLocator
         .locateRoots(includedPaths: [testFile1.path, testFile2.path]);
@@ -512,8 +512,8 @@
 
   void test_locateRoots_multiple_fileAndSiblingFile_hasOptions() {
     File optionsFile = newAnalysisOptionsYamlFile2('/home/test', '');
-    File testFile1 = newFile2('/home/test/lib/test1.dart', '');
-    File testFile2 = newFile2('/home/test/lib/test2.dart', '');
+    File testFile1 = newFile('/home/test/lib/test1.dart', '');
+    File testFile2 = newFile('/home/test/lib/test2.dart', '');
 
     List<ContextRoot> roots = contextLocator
         .locateRoots(includedPaths: [testFile1.path, testFile2.path]);
@@ -533,8 +533,8 @@
       test_locateRoots_multiple_fileAndSiblingFile_hasOptions_overrideOptions() {
     newAnalysisOptionsYamlFile2('/home/test', ''); // not used
     File overrideOptionsFile = newAnalysisOptionsYamlFile2('/home', '');
-    File testFile1 = newFile2('/home/test/lib/test1.dart', '');
-    File testFile2 = newFile2('/home/test/lib/test2.dart', '');
+    File testFile1 = newFile('/home/test/lib/test1.dart', '');
+    File testFile2 = newFile('/home/test/lib/test2.dart', '');
 
     List<ContextRoot> roots = contextLocator.locateRoots(
       includedPaths: [testFile1.path, testFile2.path],
@@ -555,8 +555,8 @@
   void test_locateRoots_multiple_fileAndSiblingFile_hasOptionsPackages() {
     File optionsFile = newAnalysisOptionsYamlFile2('/home/test', '');
     File packagesFile = newPackageConfigJsonFile('/home/test', '');
-    File testFile1 = newFile2('/home/test/lib/test1.dart', '');
-    File testFile2 = newFile2('/home/test/lib/test2.dart', '');
+    File testFile1 = newFile('/home/test/lib/test1.dart', '');
+    File testFile2 = newFile('/home/test/lib/test2.dart', '');
 
     List<ContextRoot> roots = contextLocator
         .locateRoots(includedPaths: [testFile1.path, testFile2.path]);
@@ -574,8 +574,8 @@
 
   void test_locateRoots_multiple_fileAndSiblingFile_hasPackages() {
     File packagesFile = newPackageConfigJsonFile('/home/test', '');
-    File testFile1 = newFile2('/home/test/lib/test1.dart', '');
-    File testFile2 = newFile2('/home/test/lib/test2.dart', '');
+    File testFile1 = newFile('/home/test/lib/test1.dart', '');
+    File testFile2 = newFile('/home/test/lib/test2.dart', '');
 
     List<ContextRoot> roots = contextLocator
         .locateRoots(includedPaths: [testFile1.path, testFile2.path]);
@@ -599,8 +599,8 @@
       test_locateRoots_multiple_fileAndSiblingFile_hasPackages_overridePackages() {
     newPackageConfigJsonFile('/home/test', ''); // not used
     File overridePackagesFile = newPackageConfigJsonFile('/home', '');
-    File testFile1 = newFile2('/home/test/lib/test1.dart', '');
-    File testFile2 = newFile2('/home/test/lib/test2.dart', '');
+    File testFile1 = newFile('/home/test/lib/test1.dart', '');
+    File testFile2 = newFile('/home/test/lib/test2.dart', '');
 
     List<ContextRoot> roots = contextLocator.locateRoots(
       includedPaths: [testFile1.path, testFile2.path],
@@ -621,8 +621,8 @@
   /// When there are no configuration files, we can use the root of the file
   /// system, because it contains all the files.
   void test_locateRoots_multiple_fileAndSiblingFile_noConfigurationFiles() {
-    File testFile1 = newFile2('/home/test/lib/test1.dart', '');
-    File testFile2 = newFile2('/home/test/lib/test2.dart', '');
+    File testFile1 = newFile('/home/test/lib/test1.dart', '');
+    File testFile2 = newFile('/home/test/lib/test2.dart', '');
 
     List<ContextRoot> roots = contextLocator
         .locateRoots(includedPaths: [testFile1.path, testFile2.path]);
@@ -645,13 +645,13 @@
     var pkgPath1 = '$workspacePath1/pkg1';
     var pkgPath2 = '$workspacePath2/pkg2';
 
-    newFile2('$workspacePath1/WORKSPACE', '');
-    newFile2('$workspacePath2/WORKSPACE', '');
+    newFile('$workspacePath1/WORKSPACE', '');
+    newFile('$workspacePath2/WORKSPACE', '');
     newBazelBuildFile(pkgPath1, '');
     newBazelBuildFile(pkgPath2, '');
 
-    var file1 = newFile2('$pkgPath1/lib/file1.dart', '');
-    var file2 = newFile2('$pkgPath2/lib/file2.dart', '');
+    var file1 = newFile('$pkgPath1/lib/file1.dart', '');
+    var file2 = newFile('$pkgPath2/lib/file2.dart', '');
 
     var roots = contextLocator.locateRoots(
       includedPaths: [file1.path, file2.path],
@@ -680,12 +680,12 @@
     var fooPath = '$workspacePath/foo';
     var barPath = '$workspacePath/bar';
 
-    newFile2('$workspacePath/WORKSPACE', '');
+    newFile('$workspacePath/WORKSPACE', '');
     newBazelBuildFile(fooPath, '');
     newBazelBuildFile(barPath, '');
 
-    var fooFile = newFile2('$fooPath/lib/foo.dart', '');
-    var barFile = newFile2('$barPath/lib/bar.dart', '');
+    var fooFile = newFile('$fooPath/lib/foo.dart', '');
+    var barFile = newFile('$barPath/lib/bar.dart', '');
 
     var roots = contextLocator.locateRoots(
       includedPaths: [fooFile.path, barFile.path],
@@ -709,8 +709,8 @@
     newPubspecYamlFile(fooPath, '');
     newPubspecYamlFile(barPath, '');
 
-    var fooFile = newFile2('$fooPath/lib/foo.dart', '');
-    var barFile = newFile2('$barPath/lib/bar.dart', '');
+    var fooFile = newFile('$fooPath/lib/foo.dart', '');
+    var barFile = newFile('$barPath/lib/bar.dart', '');
 
     var roots = contextLocator.locateRoots(
       includedPaths: [fooFile.path, barFile.path],
@@ -738,8 +738,8 @@
     var fooPackagesFile = newPackageConfigJsonFile('/home/foo', '');
     var barPackagesFile = newPackageConfigJsonFile('/home/bar', '');
     var optionsFile = newAnalysisOptionsYamlFile2('/home', '');
-    var fooFile = newFile2('/home/foo/lib/foo.dart', '');
-    var barFile = newFile2('/home/bar/lib/bar.dart', '');
+    var fooFile = newFile('/home/foo/lib/foo.dart', '');
+    var barFile = newFile('/home/bar/lib/bar.dart', '');
 
     List<ContextRoot> roots = contextLocator.locateRoots(
       includedPaths: [fooFile.path, barFile.path],
@@ -765,8 +765,8 @@
     var packagesFile = newPackageConfigJsonFile('/home', '');
     var fooOptionsFile = newAnalysisOptionsYamlFile2('/home/foo', '');
     var barOptionsFile = newAnalysisOptionsYamlFile2('/home/bar', '');
-    var fooFile = newFile2('/home/foo/lib/foo.dart', '');
-    var barFile = newFile2('/home/bar/lib/bar.dart', '');
+    var fooFile = newFile('/home/foo/lib/foo.dart', '');
+    var barFile = newFile('/home/bar/lib/bar.dart', '');
 
     List<ContextRoot> roots = contextLocator.locateRoots(
       includedPaths: [fooFile.path, barFile.path],
@@ -1107,8 +1107,8 @@
   void test_locateRoots_options_default_bazel() {
     var workspacePath = '/home/workspace';
     var workspaceFolder = getFolder(workspacePath);
-    newFile2('$workspacePath/WORKSPACE', '');
-    var bazelOptionsFile = newFile2(
+    newFile('$workspacePath/WORKSPACE', '');
+    var bazelOptionsFile = newFile(
       '$workspacePath/dart/analysis_options/lib/default.yaml',
       '',
     );
@@ -1131,7 +1131,7 @@
     var rootFolder = newFolder('/home/test');
 
     var flutterPath = '/home/packages/flutter';
-    var flutterAnalysisOptionsFile = newFile2(
+    var flutterAnalysisOptionsFile = newFile(
       '$flutterPath/lib/analysis_options_user.yaml',
       '',
     );
@@ -1282,7 +1282,7 @@
     File optionsFile = newAnalysisOptionsYamlFile2('/test/root', '''
 include: has_excludes.yaml
 ''');
-    newFile2('/test/root/has_excludes.yaml', '''
+    newFile('/test/root/has_excludes.yaml', '''
 analyzer:
   exclude:
     - data/**
@@ -1319,7 +1319,7 @@
   exclude:
     - bar/**
 ''');
-    newFile2('/test/root/has_excludes.yaml', '''
+    newFile('/test/root/has_excludes.yaml', '''
 analyzer:
   exclude:
     - foo/**
@@ -1466,7 +1466,7 @@
   void test_locateRoots_single_file_inheritedOptions_directPackages() {
     File optionsFile = newAnalysisOptionsYamlFile2('/test', '');
     File packagesFile = newPackageConfigJsonFile('/test/root', '');
-    File testFile = newFile2('/test/root/test.dart', '');
+    File testFile = newFile('/test/root/test.dart', '');
 
     List<ContextRoot> roots =
         contextLocator.locateRoots(includedPaths: [testFile.path]);
diff --git a/pkg/analyzer/test/src/dart/analysis/context_root_test.dart b/pkg/analyzer/test/src/dart/analysis/context_root_test.dart
index 95d12bc..3557e07 100644
--- a/pkg/analyzer/test/src/dart/analysis/context_root_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/context_root_test.dart
@@ -42,11 +42,11 @@
     String excludePath = convertPath('/test/root/exclude');
     String cPath = convertPath('/test/root/exclude/c.dart');
 
-    newFile2(optionsPath, '');
-    newFile2(readmePath, '');
-    newFile2(aPath, '');
-    newFile2(bPath, '');
-    newFile2(cPath, '');
+    newFile(optionsPath, '');
+    newFile(readmePath, '');
+    newFile(aPath, '');
+    newFile(bPath, '');
+    newFile(cPath, '');
     contextRoot.excluded.add(newFolder(excludePath));
 
     expect(contextRoot.analyzedFiles(),
@@ -55,9 +55,9 @@
 
   test_isAnalyzed_excludedByGlob_includedFile() {
     var rootPath = '/home/test';
-    var includedFile = newFile2('$rootPath/lib/a1.dart', '');
-    var excludedFile = newFile2('$rootPath/lib/a2.dart', '');
-    var implicitFile = newFile2('$rootPath/lib/b.dart', '');
+    var includedFile = newFile('$rootPath/lib/a1.dart', '');
+    var excludedFile = newFile('$rootPath/lib/a2.dart', '');
+    var implicitFile = newFile('$rootPath/lib/b.dart', '');
 
     var root = _createContextRoot(rootPath);
     root.included.add(includedFile);
@@ -80,14 +80,14 @@
 
     var includedFolderPath = convertPath('$rootPath/lib/src/included');
     var includedFolder = getFolder(includedFolderPath);
-    var includedFile1 = newFile2('$includedFolderPath/a1.dart', '');
-    var includedFile2 = newFile2('$includedFolderPath/inner/a2.dart', '');
-    var excludedFile1 = newFile2('$includedFolderPath/a1.g.dart', '');
+    var includedFile1 = newFile('$includedFolderPath/a1.dart', '');
+    var includedFile2 = newFile('$includedFolderPath/inner/a2.dart', '');
+    var excludedFile1 = newFile('$includedFolderPath/a1.g.dart', '');
 
     var excludedFolderPath = convertPath('$rootPath/lib/src/not_included');
-    var excludedFile2 = newFile2('$excludedFolderPath/b.dart', '');
+    var excludedFile2 = newFile('$excludedFolderPath/b.dart', '');
 
-    var implicitFile = newFile2('$rootPath/lib/c.dart', '');
+    var implicitFile = newFile('$rootPath/lib/c.dart', '');
 
     var root = _createContextRoot(rootPath);
     root.included.add(includedFolder);
@@ -116,20 +116,20 @@
   test_isAnalyzed_explicitlyExcluded_byFile() {
     var excludePath = convertPath('/test/root/exclude/c.dart');
     var siblingPath = convertPath('/test/root/exclude/d.dart');
-    contextRoot.excluded.add(newFile2(excludePath, ''));
+    contextRoot.excluded.add(newFile(excludePath, ''));
     expect(contextRoot.isAnalyzed(excludePath), isFalse);
     expect(contextRoot.isAnalyzed(siblingPath), isTrue);
   }
 
   test_isAnalyzed_explicitlyExcluded_byFile_analysisOptions() {
     var excludePath = convertPath('/test/root/analysis_options.yaml');
-    contextRoot.excluded.add(newFile2(excludePath, ''));
+    contextRoot.excluded.add(newFile(excludePath, ''));
     expect(contextRoot.isAnalyzed(excludePath), isFalse);
   }
 
   test_isAnalyzed_explicitlyExcluded_byFile_pubspec() {
     var excludePath = convertPath('/test/root/pubspec.yaml');
-    contextRoot.excluded.add(newFile2(excludePath, ''));
+    contextRoot.excluded.add(newFile(excludePath, ''));
     expect(contextRoot.isAnalyzed(excludePath), isFalse);
   }
 
diff --git a/pkg/analyzer/test/src/dart/analysis/dependency/base.dart b/pkg/analyzer/test/src/dart/analysis/dependency/base.dart
index c263789..c53ca65 100644
--- a/pkg/analyzer/test/src/dart/analysis/dependency/base.dart
+++ b/pkg/analyzer/test/src/dart/analysis/dependency/base.dart
@@ -60,7 +60,7 @@
 //      await _addLibraryByUri('dart:_internal');
 //    }
 
-    newFile2(path, content);
+    newFile(path, content);
 
     var analysisDriver = driverFor(path);
     analysisDriver.changeFile(path);
diff --git a/pkg/analyzer/test/src/dart/analysis/dependency/reference_collector_test.dart b/pkg/analyzer/test/src/dart/analysis/dependency/reference_collector_test.dart
index 38d8b2d..a705db6 100644
--- a/pkg/analyzer/test/src/dart/analysis/dependency/reference_collector_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/dependency/reference_collector_test.dart
@@ -1085,7 +1085,7 @@
   }
 
   test_prefixedIdentifier_importPrefix() async {
-    newFile2(b, 'var b = 0;');
+    newFile(b, 'var b = 0;');
     var library = await buildTestLibrary(a, r'''
 import 'b.dart' as pb;
 
@@ -1099,7 +1099,7 @@
   }
 
   test_prefixedIdentifier_importPrefix_unresolvedIdentifier() async {
-    newFile2(b, '');
+    newFile(b, '');
     var library = await buildTestLibrary(a, r'''
 import 'b.dart' as pb;
 
@@ -1420,7 +1420,7 @@
   }
 
   test_class_constructor_factoryRedirect_named_prefixed() async {
-    newFile2(b, 'class A {}');
+    newFile(b, 'class A {}');
 
     var library = await buildTestLibrary(a, r'''
 import 'b.dart' as p;
@@ -1464,7 +1464,7 @@
   }
 
   test_class_constructor_factoryRedirect_unnamed_prefixed() async {
-    newFile2(b, 'class A {}');
+    newFile(b, 'class A {}');
 
     var library = await buildTestLibrary(a, r'''
 import 'b.dart' as p;
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_caching_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_caching_test.dart
index 930ee37..28a1626 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_caching_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_caching_test.dart
@@ -37,7 +37,7 @@
       ),
     );
 
-    newFile2(testFilePath, r'''
+    newFile(testFilePath, r'''
 dynamic a = 0;
 int b = a;
 ''');
@@ -119,7 +119,7 @@
   test_change_field_staticFinal_hasConstConstructor_changeInitializer() async {
     useEmptyByteStore();
 
-    newFile2(testFilePath, r'''
+    newFile(testFilePath, r'''
 class A {
   static const a = 0;
   static const b = 1;
@@ -139,7 +139,7 @@
     // We will reuse the byte store, so can reuse summaries.
     disposeAnalysisContextCollection();
 
-    newFile2(testFilePath, r'''
+    newFile(testFilePath, r'''
 class A {
   static const a = 0;
   static const b = 1;
@@ -160,7 +160,7 @@
   test_change_functionBody() async {
     useEmptyByteStore();
 
-    newFile2(testFilePath, r'''
+    newFile(testFilePath, r'''
 void f() {
   print(0);
 }
@@ -177,7 +177,7 @@
     // We will reuse the byte store, so can reuse summaries.
     disposeAnalysisContextCollection();
 
-    newFile2(testFilePath, r'''
+    newFile(testFilePath, r'''
 void f() {
   print(1);
 }
@@ -193,8 +193,8 @@
   test_getLibraryByUri_invalidated_exportNamespace() async {
     useEmptyByteStore();
 
-    var a = newFile2('$testPackageLibPath/a.dart', 'const a1 = 0;');
-    newFile2('$testPackageLibPath/b.dart', r'''
+    var a = newFile('$testPackageLibPath/a.dart', 'const a1 = 0;');
+    newFile('$testPackageLibPath/b.dart', r'''
 import 'a.dart';
 ''');
 
@@ -244,7 +244,7 @@
     useEmptyByteStore();
 
     var aaaPackageRootPath = '$packagesRootPath/aaa';
-    newFile2('$aaaPackageRootPath/lib/a.dart', '');
+    newFile('$aaaPackageRootPath/lib/a.dart', '');
 
     writeTestPackageConfig(
       PackageConfigFileBuilder()
@@ -265,7 +265,7 @@
       ),
     );
 
-    newFile2(testFilePath, r'''
+    newFile(testFilePath, r'''
 // ignore:unused_import
 import 'package:aaa/a.dart';
 ''');
@@ -308,7 +308,7 @@
       AnalysisOptionsFileConfig(lints: []),
     );
 
-    newFile2(testFilePath, r'''
+    newFile(testFilePath, r'''
 void f() {
   ![0].isEmpty;
 }
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
index 83e4941..bc60abe9 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_resolution_test.dart
@@ -247,7 +247,7 @@
   }
 
   test_annotation_onDirective_part() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 part of 'test.dart';
 ''');
     addTestFile(r'''
@@ -270,7 +270,7 @@
   }
 
   test_annotation_onDirective_partOf() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 part 'test.dart';
 ''');
     addTestFile(r'''
@@ -393,7 +393,7 @@
   }
 
   test_annotation_prefixed_classField() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static const a = 1;
 }
@@ -432,7 +432,7 @@
   }
 
   test_annotation_prefixed_constructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A(int a, {int b});
 }
@@ -473,7 +473,7 @@
   }
 
   test_annotation_prefixed_constructor_named() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A.named(int a, {int b});
 }
@@ -516,7 +516,7 @@
   }
 
   test_annotation_prefixed_topLevelVariable() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const topAnnotation = 1;
 ''');
     addTestFile(r'''
@@ -1422,7 +1422,7 @@
   }
 
   test_deferredImport_loadLibrary_invocation() async {
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
     addTestFile(r'''
 import 'a.dart' deferred as a;
 main() {
@@ -1446,7 +1446,7 @@
   }
 
   test_deferredImport_loadLibrary_invocation_argument() async {
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
     addTestFile(r'''
 import 'a.dart' deferred as a;
 var b = 1;
@@ -1480,7 +1480,7 @@
   }
 
   test_deferredImport_loadLibrary_tearOff() async {
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
     addTestFile(r'''
 import 'a.dart' deferred as a;
 main() {
@@ -1503,7 +1503,7 @@
   }
 
   test_deferredImport_variable() async {
-    newFile2('$testPackageLibPath/a.dart', 'var v = 0;');
+    newFile('$testPackageLibPath/a.dart', 'var v = 0;');
     addTestFile(r'''
 import 'a.dart' deferred as a;
 main() async {
@@ -1542,7 +1542,7 @@
   }
 
   test_directive_export() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class MyClass {}
 int myVar;
 int get myGetter => 0;
@@ -1590,7 +1590,7 @@
   }
 
   test_directive_import_hide() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class MyClass {}
 int myVar;
 int get myGetter => 0;
@@ -1638,7 +1638,7 @@
   }
 
   test_directive_import_show() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class MyClass {}
 int myVar;
 int get myGetter => 0;
@@ -2187,7 +2187,7 @@
   }
 
   test_instanceCreation_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class C<T> {
   C(T p);
   C.named(T p);
@@ -3595,7 +3595,7 @@
 
   @failingTest
   test_invalid_nonTypeAsType_topLevelFunction_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int T() => 0;
 ''');
     addTestFile(r'''
@@ -3663,7 +3663,7 @@
 
   @failingTest
   test_invalid_nonTypeAsType_topLevelVariable_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int T;
 ''');
     addTestFile(r'''
@@ -5618,7 +5618,7 @@
   }
 
   test_optionalConst_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class C {
   const C();
   const C.named();
@@ -6132,7 +6132,7 @@
   }
 
   test_prefixedIdentifier_importPrefix_className() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class MyClass {}
 typedef void MyFunctionTypeAlias();
 int myTopVariable;
@@ -7733,9 +7733,9 @@
   }
 
   test_typeAnnotation_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
-    newFile2('$testPackageLibPath/b.dart', "export 'a.dart';");
-    newFile2('$testPackageLibPath/c.dart', "export 'a.dart';");
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/b.dart', "export 'a.dart';");
+    newFile('$testPackageLibPath/c.dart', "export 'a.dart';");
     addTestFile(r'''
 import 'b.dart' as b;
 import 'c.dart' as c;
diff --git a/pkg/analyzer/test/src/dart/analysis/driver_test.dart b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
index a5b3e67..2493532 100644
--- a/pkg/analyzer/test/src/dart/analysis/driver_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/driver_test.dart
@@ -58,7 +58,7 @@
 
     var innerPath = convertPath('$outerLibPath/inner/lib/b.dart');
     var innerUri = Uri.parse('package:my.outer.lib.inner/b.dart');
-    newFile2(innerPath, 'class B {}');
+    newFile(innerPath, 'class B {}');
 
     var analysisSession = contextFor(innerPath).currentSession;
 
@@ -71,7 +71,7 @@
 
     // Reference "inner" using a non-canonical URI.
     {
-      var a = newFile2(convertPath('$outerLibPath/a.dart'), r'''
+      var a = newFile(convertPath('$outerLibPath/a.dart'), r'''
 import 'inner/lib/b.dart';
 ''');
       var result = await analysisSession.getResolvedUnit(a.path);
@@ -81,7 +81,7 @@
 
     // Reference "inner" using the canonical URI, via relative.
     {
-      var c = newFile2('$outerLibPath/inner/lib/c.dart', r'''
+      var c = newFile('$outerLibPath/inner/lib/c.dart', r'''
 import 'b.dart';
 ''');
       var result = await analysisSession.getResolvedUnit(c.path);
@@ -91,7 +91,7 @@
 
     // Reference "inner" using the canonical URI, via absolute.
     {
-      var d = newFile2('$outerLibPath/inner/lib/d.dart', '''
+      var d = newFile('$outerLibPath/inner/lib/d.dart', '''
 import '$innerUri';
 ''');
       var result = await analysisSession.getResolvedUnit(d.path);
@@ -153,10 +153,10 @@
     String b = convertPath('/b.dart');
     String c = convertPath('/c.dart');
     String d = convertPath('/d.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, "import 'a.dart';");
-    newFile2(c, 'class C {}');
-    newFile2(d, "import 'c.dart';");
+    newFile(a, 'class A {}');
+    newFile(b, "import 'a.dart';");
+    newFile(c, 'class C {}');
+    newFile(d, "import 'c.dart';");
     driver1.addFile(a);
     driver1.addFile(b);
     driver2.addFile(c);
@@ -185,9 +185,9 @@
     String a = convertPath('/a.dart');
     String b = convertPath('/b.dart');
     String c = convertPath('/c.dart');
-    newFile2(a, "import 'c.dart';");
-    newFile2(b, 'class B {}');
-    newFile2(c, "import 'b.dart';");
+    newFile(a, "import 'c.dart';");
+    newFile(b, 'class B {}');
+    newFile(c, "import 'b.dart';");
     driver1.addFile(a);
     driver1.addFile(b);
     driver2.addFile(c);
@@ -213,10 +213,10 @@
     String b = convertPath('/b.dart');
     String c = convertPath('/c.dart');
     String d = convertPath('/d.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, "export 'a.dart';");
-    newFile2(c, "import 'b.dart';");
-    newFile2(d, "import 'b.dart'; class D extends X {}");
+    newFile(a, 'class A {}');
+    newFile(b, "export 'a.dart';");
+    newFile(c, "import 'b.dart';");
+    newFile(d, "import 'b.dart'; class D extends X {}");
     driver1.addFile(a);
     driver1.addFile(b);
     driver2.addFile(c);
@@ -242,9 +242,9 @@
     String a = convertPath('/a.dart');
     String b = convertPath('/b.dart');
     String c = convertPath('/c.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
-    newFile2(c, 'class C {}');
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
+    newFile(c, 'class C {}');
     driver1.addFile(a);
     driver2.addFile(b);
     driver2.addFile(c);
@@ -268,8 +268,8 @@
 
     String a = convertPath('/a.dart');
     String b = convertPath('/b.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
     driver1.addFile(a);
     driver2.addFile(b);
     driver1.priorityFiles = [a];
@@ -288,8 +288,8 @@
 
     String a = convertPath('/a.dart');
     String b = convertPath('/b.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
     driver1.addFile(a);
     driver2.addFile(b);
     driver1.priorityFiles = [b];
@@ -309,9 +309,9 @@
     String a = convertPath('/a.dart');
     String b = convertPath('/b.dart');
     String c = convertPath('/c.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
-    newFile2(c, 'class C {}');
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
+    newFile(c, 'class C {}');
     driver1.addFile(a);
     driver1.addFile(b);
     driver2.addFile(c);
@@ -333,9 +333,9 @@
     String a = convertPath('/a.dart');
     String b = convertPath('/b.dart');
     String c = convertPath('/c.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
-    newFile2(c, 'class C {}');
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
+    newFile(c, 'class C {}');
     driver1.addFile(a);
     driver2.addFile(b);
     driver2.addFile(c);
@@ -366,8 +366,8 @@
 
     String a = convertPath('/a.dart');
     String b = convertPath('/b.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
     driver1.addFile(a);
     driver2.addFile(b);
 
@@ -427,8 +427,8 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
 
-    newFile2(a, 'class A {}');
-    newFile2(b, r'''
+    newFile(a, 'class A {}');
+    newFile(b, r'''
 import 'a.dart';
 ''');
 
@@ -446,7 +446,7 @@
     assertNumberOfErrorsInB(1);
 
     // Update 'b' to use 'a', no more hints.
-    newFile2(b, r'''
+    newFile(b, r'''
 import 'a.dart';
 main() {
   print(A);
@@ -459,7 +459,7 @@
     // Change 'b' content so that it has a hint.
     // Remove 'b' and add it again.
     // The file 'b' must be refreshed, and the hint must be reported.
-    newFile2(b, r'''
+    newFile(b, r'''
 import 'a.dart';
 ''');
     driver.removeFile(b);
@@ -471,8 +471,8 @@
   test_addFile_thenRemove() async {
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
     driver.addFile(a);
     driver.addFile(b);
 
@@ -490,15 +490,15 @@
     var lib = convertPath('/test/lib.dart');
     var part1 = convertPath('/test/part1.dart');
     var part2 = convertPath('/test/part2.dart');
-    newFile2(lib, '''
+    newFile(lib, '''
 library lib;
 part 'part1.dart';
 part 'part2.dart';
 ''');
-    newFile2(part1, '''
+    newFile(part1, '''
 part of lib;
 ''');
-    newFile2(part2, '''
+    newFile(part2, '''
 part of 'lib.dart';
 ''');
 
@@ -540,10 +540,10 @@
   test_analyze_resolveDirectives_error_missingLibraryDirective() async {
     var lib = convertPath('/test/lib.dart');
     var part = convertPath('/test/part.dart');
-    newFile2(lib, '''
+    newFile(lib, '''
 part 'part.dart';
 ''');
-    newFile2(part, '''
+    newFile(part, '''
 part of lib;
 ''');
 
@@ -558,11 +558,11 @@
   test_analyze_resolveDirectives_error_partOfDifferentLibrary_byName() async {
     var lib = convertPath('/test/lib.dart');
     var part = convertPath('/test/part.dart');
-    newFile2(lib, '''
+    newFile(lib, '''
 library lib;
 part 'part.dart';
 ''');
-    newFile2(part, '''
+    newFile(part, '''
 part of someOtherLib;
 ''');
 
@@ -577,11 +577,11 @@
   test_analyze_resolveDirectives_error_partOfDifferentLibrary_byUri() async {
     var lib = convertPath('/test/lib.dart');
     var part = convertPath('/test/part.dart');
-    newFile2(lib, '''
+    newFile(lib, '''
 library lib;
 part 'part.dart';
 ''');
-    newFile2(part, '''
+    newFile(part, '''
 part of 'other_lib.dart';
 ''');
 
@@ -596,11 +596,11 @@
   test_analyze_resolveDirectives_error_partOfNonPart() async {
     var lib = convertPath('/test/lib.dart');
     var part = convertPath('/test/part.dart');
-    newFile2(lib, '''
+    newFile(lib, '''
 library lib;
 part 'part.dart';
 ''');
-    newFile2(part, '''
+    newFile(part, '''
 // no part of directive
 ''');
 
@@ -614,7 +614,7 @@
 
   test_cachedPriorityResults() async {
     var a = convertPath('/test/bin/a.dart');
-    newFile2(a, 'var a = 1;');
+    newFile(a, 'var a = 1;');
 
     driver.priorityFiles = [a];
 
@@ -644,8 +644,8 @@
   test_cachedPriorityResults_flush_onAnyFileChange() async {
     var a = convertPath('/test/bin/a.dart');
     var b = convertPath('/test/bin/b.dart');
-    newFile2(a, 'var a = 1;');
-    newFile2(a, 'var b = 2;');
+    newFile(a, 'var a = 1;');
+    newFile(a, 'var b = 2;');
 
     driver.priorityFiles = [a];
 
@@ -675,8 +675,8 @@
   test_cachedPriorityResults_flush_onPrioritySetChange() async {
     var a = convertPath('/test/bin/a.dart');
     var b = convertPath('/test/bin/b.dart');
-    newFile2(a, 'var a = 1;');
-    newFile2(b, 'var b = 2;');
+    newFile(a, 'var a = 1;');
+    newFile(b, 'var b = 2;');
 
     driver.priorityFiles = [a];
 
@@ -705,7 +705,7 @@
 
   test_cachedPriorityResults_notPriority() async {
     var a = convertPath('/test/bin/a.dart');
-    newFile2(a, 'var a = 1;');
+    newFile(a, 'var a = 1;');
 
     ResolvedUnitResult result1 = await driver.getResultValid(a);
     expect(driver.test.priorityResults, isEmpty);
@@ -718,11 +718,11 @@
   test_changeFile_implicitlyAnalyzed() async {
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 import 'b.dart';
 var A = B;
 ''');
-    newFile2(b, 'var B = 1;');
+    newFile(b, 'var B = 1;');
 
     driver.priorityFiles = [a];
     driver.addFile(a);
@@ -766,8 +766,8 @@
   test_changeFile_notUsed() async {
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/other/b.dart');
-    newFile2(a, '');
-    newFile2(b, 'class B1 {}');
+    newFile(a, '');
+    newFile(b, 'class B1 {}');
 
     driver.addFile(a);
 
@@ -786,17 +786,17 @@
   }
 
   test_changeFile_potentiallyAffected_imported() async {
-    newFile2('/test/lib/a.dart', '');
-    var b = newFile2('/test/lib/b.dart', '''
+    newFile('/test/lib/a.dart', '');
+    var b = newFile('/test/lib/b.dart', '''
 import 'a.dart';
 ''');
-    var c = newFile2('/test/lib/c.dart', '''
+    var c = newFile('/test/lib/c.dart', '''
 import 'b.dart';
 ''');
-    var d = newFile2('/test/lib/d.dart', '''
+    var d = newFile('/test/lib/d.dart', '''
 import 'c.dart';
 ''');
-    newFile2('/test/lib/e.dart', '');
+    newFile('/test/lib/e.dart', '');
 
     Future<LibraryElementImpl> getLibrary(String shortName) async {
       var uriStr = 'package:test/$shortName';
@@ -861,16 +861,16 @@
   }
 
   test_changeFile_potentiallyAffected_part() async {
-    var a = newFile2('/test/lib/a.dart', '''
+    var a = newFile('/test/lib/a.dart', '''
 part of 'b.dart';
 ''');
-    var b = newFile2('/test/lib/b.dart', '''
+    var b = newFile('/test/lib/b.dart', '''
 part 'a.dart';
 ''');
-    var c = newFile2('/test/lib/c.dart', '''
+    var c = newFile('/test/lib/c.dart', '''
 import 'b.dart';
 ''');
-    newFile2('/test/lib/d.dart', '');
+    newFile('/test/lib/d.dart', '');
 
     Future<LibraryElementImpl> getLibrary(String shortName) async {
       var uriStr = 'package:test/$shortName';
@@ -928,12 +928,12 @@
   test_changeFile_selfConsistent() async {
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 import 'b.dart';
 var A1 = 1;
 var A2 = B1;
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 import 'a.dart';
 var B1 = A1;
 ''');
@@ -1110,13 +1110,13 @@
   test_const_implicitCreation() async {
     var a = convertPath('/test/bin/a.dart');
     var b = convertPath('/test/bin/b.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 class C {
   const C();
   static const C WARNING = C();
 }
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 import 'a.dart';
 
 class D {
@@ -1134,7 +1134,7 @@
   test_const_implicitCreation_rewrite() async {
     var a = convertPath('/test/bin/a.dart');
     var b = convertPath('/test/bin/b.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 class A {
   const A();
 }
@@ -1149,7 +1149,7 @@
   const C();
 }
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 import 'a.dart';
 
 main() {
@@ -1185,7 +1185,7 @@
   test_currentSession() async {
     var a = convertPath('/test/lib/a.dart');
 
-    newFile2(a, 'var V = 1;');
+    newFile(a, 'var V = 1;');
     await driver.getResultValid(a);
 
     var session1 = driver.currentSession;
@@ -1210,12 +1210,12 @@
     var b = convertPath('/bbb/lib/b.dart');
     var c = convertPath('/ccc/lib/c.dart');
 
-    newFile2(t, 'class T {}');
-    newFile2(a1, 'class A1 {}');
-    newFile2(a2, 'class A2 {}');
-    newFile2(a3, 'text');
-    newFile2(b, 'class B {}');
-    newFile2(c, 'class C {}');
+    newFile(t, 'class T {}');
+    newFile(a1, 'class A1 {}');
+    newFile(a2, 'class A2 {}');
+    newFile(a3, 'text');
+    newFile(b, 'class B {}');
+    newFile(c, 'class C {}');
 
     driver.addFile(t);
     // Don't add a1.dart, a2.dart, or b.dart - they should be discovered.
@@ -1302,12 +1302,12 @@
     String templatePath = convertPath('/aaa/lib/foo.dart');
     String generatedPath = convertPath('/generated/aaa/lib/foo.dart');
 
-    newFile2(templatePath, r'''
+    newFile(templatePath, r'''
 a() {}
 b() {}
 ''');
 
-    newFile2(generatedPath, r'''
+    newFile(generatedPath, r'''
 aaa() {}
 bbb() {}
 ''');
@@ -1361,7 +1361,7 @@
 
   test_getCachedResult() async {
     var a = convertPath('/test/bin/a.dart');
-    newFile2(a, 'var a = 1;');
+    newFile(a, 'var a = 1;');
 
     expect(driver.getCachedResult(a), isNull);
 
@@ -1392,10 +1392,10 @@
     var c = convertPath('/test/bin/c.dart');
     var d = convertPath('/test/bin/d.dart');
 
-    newFile2(a, 'class A { m1() {} }');
-    newFile2(b, 'class B { m2() {} }');
-    newFile2(c, 'class C { m2() {} }');
-    newFile2(d, 'class D { m3() {} }');
+    newFile(a, 'class A { m1() {} }');
+    newFile(b, 'class B { m2() {} }');
+    newFile(c, 'class C { m2() {} }');
+    newFile(d, 'class D { m3() {} }');
 
     driver.addFile(a);
     driver.addFile(b);
@@ -1418,10 +1418,10 @@
     var c = convertPath('/test/bin/c.dart');
     var d = convertPath('/test/bin/d.dart');
 
-    newFile2(a, 'mixin A { m1() {} }');
-    newFile2(b, 'mixin B { m2() {} }');
-    newFile2(c, 'mixin C { m2() {} }');
-    newFile2(d, 'mixin D { m3() {} }');
+    newFile(a, 'mixin A { m1() {} }');
+    newFile(b, 'mixin B { m2() {} }');
+    newFile(c, 'mixin C { m2() {} }');
+    newFile(d, 'mixin D { m3() {} }');
 
     driver.addFile(a);
     driver.addFile(b);
@@ -1445,11 +1445,11 @@
     var d = convertPath('/test/bin/d.dart');
     var e = convertPath('/test/bin/e.dart');
 
-    newFile2(a, 'class A {}');
-    newFile2(b, "import 'a.dart'; A a;");
-    newFile2(c, "import 'a.dart'; var a = new A();");
-    newFile2(d, "class A{} A a;");
-    newFile2(e, "import 'a.dart'; main() {}");
+    newFile(a, 'class A {}');
+    newFile(b, "import 'a.dart'; A a;");
+    newFile(c, "import 'a.dart'; var a = new A();");
+    newFile(d, "class A{} A a;");
+    newFile(e, "import 'a.dart'; main() {}");
 
     driver.addFile(a);
     driver.addFile(b);
@@ -1475,10 +1475,10 @@
     var b = convertPath('/bbb/lib/b.dart');
     var c = convertPath('/ccc/lib/c.dart');
 
-    newFile2(t, 'int t;');
-    newFile2(a, 'int a;');
-    newFile2(b, 'int b;');
-    newFile2(c, 'int c;');
+    newFile(t, 'int t;');
+    newFile(a, 'int a;');
+    newFile(b, 'int b;');
+    newFile(c, 'int c;');
 
     driver.addFile(t);
 
@@ -1493,8 +1493,8 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
 
-    newFile2(a, '');
-    newFile2(b, r'''
+    newFile(a, '');
+    newFile(b, r'''
 import 'a.dart';
 
 void f(A a) {}
@@ -1506,7 +1506,7 @@
 
     // Update the file, changing its API signature.
     // Note that we don't call `changeFile`.
-    newFile2(a, 'class A {}\n');
+    newFile(a, 'class A {}\n');
 
     // Get the file.
     // We have not called `changeFile(a)`, so we should not read the file.
@@ -1531,7 +1531,7 @@
 
   test_getFileSync_library() async {
     var path = convertPath('/test/lib/a.dart');
-    newFile2(path, '');
+    newFile(path, '');
     var file = driver.getFileSyncValid(path);
     expect(file.path, path);
     expect(file.uri.toString(), 'package:test/a.dart');
@@ -1545,7 +1545,7 @@
 
   test_getFileSync_part() async {
     var path = convertPath('/test/lib/a.dart');
-    newFile2(path, 'part of lib;');
+    newFile(path, 'part of lib;');
     var file = driver.getFileSyncValid(path);
     expect(file.path, path);
     expect(file.uri.toString(), 'package:test/a.dart');
@@ -1582,13 +1582,13 @@
     String aUriStr = 'package:test/a.dart';
     String bUriStr = 'package:test/b.dart';
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part 'b.dart';
 
 class A {}
 ''');
 
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 
 class B {}
@@ -1735,8 +1735,8 @@
   test_getResult_constants_defaultParameterValue_localFunction() async {
     var a = convertPath('/test/bin/a.dart');
     var b = convertPath('/test/bin/b.dart');
-    newFile2(a, 'const C = 42;');
-    newFile2(b, r'''
+    newFile(a, 'const C = 42;');
+    newFile(b, r'''
 import 'a.dart';
 main() {
   foo({int p: C}) {}
@@ -1814,8 +1814,8 @@
   test_getResult_importLibrary_thenRemoveIt() async {
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, r'''
+    newFile(a, 'class A {}');
+    newFile(b, r'''
 import 'a.dart';
 class B extends A {}
 ''');
@@ -1844,7 +1844,7 @@
     }
 
     // Restore a.dart and reanalyze.
-    newFile2(a, 'class A {}');
+    newFile(a, 'class A {}');
     driver.addFile(a);
 
     // No errors in b.dart again.
@@ -1977,7 +1977,7 @@
 
   test_getResult_languageVersion() async {
     var path = convertPath('/test/lib/test.dart');
-    newFile2(path, r'''
+    newFile(path, r'''
 // @dart = 2.7
 class A{}
 ''');
@@ -1993,19 +1993,19 @@
     var b = convertPath('/test/bin/b.dart');
     var c = convertPath('/test/lib/c.dart');
     var d = convertPath('/test/test/d.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 import 'package:test/c.dart';
 int x = y;
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 import '../lib/c.dart';
 int x = y;
 ''');
-    newFile2(c, r'''
+    newFile(c, r'''
 import '../test/d.dart';
 var y = z;
 ''');
-    newFile2(d, r'''
+    newFile(d, r'''
 String z = "string";
 ''');
 
@@ -2059,7 +2059,7 @@
 
   test_getResult_notDartFile() async {
     var path = convertPath('/test/lib/test.txt');
-    newFile2(path, 'class A {}');
+    newFile(path, 'class A {}');
 
     ResolvedUnitResult result = await driver.getResultValid(path);
     expect(result, isNotNull);
@@ -2080,12 +2080,12 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/test/c.dart');
-    newFile2(a, 'class A<T> {}');
-    newFile2(b, r'''
+    newFile(a, 'class A<T> {}');
+    newFile(b, r'''
 import 'a.dart';
 var VB = new A<int>();
 ''');
-    newFile2(c, r'''
+    newFile(c, r'''
 import '../lib/a.dart';
 var VC = new A<double>();
 ''');
@@ -2116,12 +2116,12 @@
   test_getResult_selfConsistent() async {
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 import 'b.dart';
 var A1 = 1;
 var A2 = B1;
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 import 'a.dart';
 var B1 = A1;
 ''');
@@ -2204,7 +2204,7 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 import 'package:test/b.dart';
 ''');
 
@@ -2219,7 +2219,7 @@
 
   test_getUnitElement_notDart() async {
     var path = convertPath('/test.txt');
-    newFile2(path, 'class A {}');
+    newFile(path, 'class A {}');
     var unitResult = await driver.getUnitElement(path);
     unitResult as UnitElementResult;
     expect(unitResult.element.classes.map((e) => e.name), ['A']);
@@ -2260,14 +2260,14 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 part 'b.dart';
 class C {
   int foo;
 }
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 part of a;
 var c = new C();
 ''');
@@ -2279,7 +2279,7 @@
 
     // Modify the library, but don't notify the driver.
     // The driver should use the previous library content and elements.
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 part 'b.dart';
 class C {
@@ -2300,17 +2300,17 @@
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
 
-    newFile2(a, '''
+    newFile(a, '''
 library my.lib;
 
 part 'b.dart';
 ''');
-    newFile2(b, '''
+    newFile(b, '''
 part of my.lib;
 
 class A {}
 ''');
-    newFile2(c, '''
+    newFile(c, '''
 import 'b.dart';
 ''');
 
@@ -2323,7 +2323,7 @@
 
   test_instantiateToBounds_invalid() async {
     var a = convertPath('/test/lib/a.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 class A<T extends B> {}
 class B<T extends A<B>> {}
 ''');
@@ -2344,7 +2344,7 @@
 
   test_issue34619() async {
     var a = convertPath('/test/lib/a.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 class C {
   final Set<String> f = new Set<String>();
 
@@ -2374,11 +2374,11 @@
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 import 'b.dart';
 ''');
-    newFile2(b, '');
-    newFile2(c, '');
+    newFile(b, '');
+    newFile(c, '');
 
     driver.addFile(a);
     driver.addFile(c);
@@ -2401,7 +2401,7 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
 
-    newFile2(a, '');
+    newFile(a, '');
 
     // 'a.dart' is added, but not processed yet.
     // So, the set of known files is empty yet.
@@ -2444,8 +2444,8 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
 
-    newFile2(a, '');
-    newFile2(b, r'''
+    newFile(a, '');
+    newFile(b, r'''
 import 'a.dart';
 
 void f(A a) {}
@@ -2457,7 +2457,7 @@
 
     // Update the file, changing its API signature.
     // Note that we don't call `changeFile`.
-    newFile2(a, 'class A {}');
+    newFile(a, 'class A {}');
 
     // Parse the file.
     // We have not called `changeFile(a)`, so we should not read the file.
@@ -2496,8 +2496,8 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
 
-    newFile2(a, '');
-    newFile2(b, r'''
+    newFile(a, '');
+    newFile(b, r'''
 import 'a.dart';
 ''');
 
@@ -2516,10 +2516,10 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part of my;
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 library my;
 part 'a.dart';
 ''');
@@ -2538,7 +2538,7 @@
   test_parseFileSync_languageVersion() async {
     var path = convertPath('/test/lib/test.dart');
 
-    newFile2(path, r'''
+    newFile(path, r'''
 // @dart = 2.7
 class A {}
 ''');
@@ -2552,7 +2552,7 @@
   test_parseFileSync_languageVersion_null() async {
     var path = convertPath('/test/lib/test.dart');
 
-    newFile2(path, r'''
+    newFile(path, r'''
 class A {}
 ''');
 
@@ -2567,7 +2567,7 @@
 
   test_parseFileSync_notDart() async {
     var p = convertPath('/test/bin/a.txt');
-    newFile2(p, 'class A {}');
+    newFile(p, 'class A {}');
 
     var parseResult = driver.parseFileSync(p) as ParsedUnitResult;
     expect(parseResult, isNotNull);
@@ -2578,15 +2578,15 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 import 'b.dart';
 part 'c.dart';
 class A {}
 var c = new C();
 ''');
-    newFile2(b, 'class B {}');
-    newFile2(c, r'''
+    newFile(b, 'class B {}');
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2614,15 +2614,15 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 import 'b.dart';
 part 'c.dart';
 class A {}
 var c = new C();
 ''');
-    newFile2(b, 'class B {}');
-    newFile2(c, r'''
+    newFile(b, 'class B {}');
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2644,15 +2644,15 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 import 'b.dart';
 part 'c.dart';
 class A {}
 var c = new C();
 ''');
-    newFile2(b, 'class B {}');
-    newFile2(c, r'''
+    newFile(b, 'class B {}');
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2683,15 +2683,15 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 import 'b.dart';
 part 'c.dart';
 class A {}
 var c = new C();
 ''');
-    newFile2(b, 'class B {}');
-    newFile2(c, r'''
+    newFile(b, 'class B {}');
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2713,7 +2713,7 @@
   test_part_getResult_changePart_invalidatesLibraryCycle() async {
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 import 'dart:async';
 part 'b.dart';
 ''');
@@ -2725,7 +2725,7 @@
     // Create the part file.
     // This should invalidate library file state (specifically the library
     // cycle), so that we can re-link the library, and get new dependencies.
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 Future<int> f;
 ''');
@@ -2738,7 +2738,7 @@
 
   test_part_getResult_noLibrary() async {
     var c = convertPath('/test/lib/c.dart');
-    newFile2(c, r'''
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2758,15 +2758,15 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 import 'b.dart';
 part 'c.dart';
 class A {}
 var c = new C();
 ''');
-    newFile2(b, 'class B {}');
-    newFile2(c, r'''
+    newFile(b, 'class B {}');
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2798,15 +2798,15 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 import 'b.dart';
 part 'c.dart';
 class A {}
 var c = new C();
 ''');
-    newFile2(b, 'class B {}');
-    newFile2(c, r'''
+    newFile(b, 'class B {}');
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2833,7 +2833,7 @@
 
   test_part_getUnitElement_noLibrary() async {
     var c = convertPath('/test/lib/c.dart');
-    newFile2(c, r'''
+    newFile(c, r'''
 part of a;
 var a = new A();
 var b = new B();
@@ -2860,15 +2860,15 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 import 'b.dart';
 part 'c.dart';
 class A {}
 var c = new C();
 ''');
-    newFile2(b, 'class B {}');
-    newFile2(c, r'''
+    newFile(b, 'class B {}');
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2908,15 +2908,15 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 import 'b.dart';
 part 'c.dart';
 class A {}
 var c = new C();
 ''');
-    newFile2(b, 'class B {}');
-    newFile2(c, r'''
+    newFile(b, 'class B {}');
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2941,7 +2941,7 @@
 
   test_part_results_noLibrary() async {
     var c = convertPath('/test/lib/c.dart');
-    newFile2(c, r'''
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2963,15 +2963,15 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library a;
 import 'b.dart';
 part 'c.dart';
 class A {}
 var c = new C();
 ''');
-    newFile2(b, 'class B {}');
-    newFile2(c, r'''
+    newFile(b, 'class B {}');
+    newFile(c, r'''
 part of a;
 class C {}
 var a = new A();
@@ -2999,7 +2999,7 @@
 
   test_removeFile_addFile_results() async {
     var a = convertPath('/test/lib/a.dart');
-    newFile2(a, 'class A {}');
+    newFile(a, 'class A {}');
 
     driver.addFile(a);
 
@@ -3018,11 +3018,11 @@
   test_removeFile_changeFile_implicitlyAnalyzed() async {
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 import 'b.dart';
 var A = B;
 ''');
-    newFile2(b, 'var B = 1;');
+    newFile(b, 'var B = 1;');
 
     driver.priorityFiles = [a, b];
     driver.addFile(a);
@@ -3086,8 +3086,8 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
 
-    newFile2(a, 'class A {}');
-    newFile2(b, "import 'a.dart';  var a = new A();");
+    newFile(a, 'class A {}');
+    newFile(b, "import 'a.dart';  var a = new A();");
 
     driver.addFile(a);
     driver.addFile(b);
@@ -3118,20 +3118,20 @@
     var d = convertPath('/test/lib/d.dart');
     var e = convertPath('/test/lib/e.dart');
     var f = convertPath('/test/lib/f.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 import 'd.dart';
 ''');
-    newFile2(b, '');
-    newFile2(c, r'''
+    newFile(b, '');
+    newFile(c, r'''
 import 'd.dart';
 ''');
-    newFile2(d, r'''
+    newFile(d, r'''
 import 'b.dart';
 ''');
-    newFile2(e, r'''
+    newFile(e, r'''
 export 'b.dart';
 ''');
-    newFile2(f, r'''
+    newFile(f, r'''
 import 'e.dart';
 class F extends X {}
 ''');
@@ -3173,11 +3173,11 @@
     var c = convertPath('/test/lib/c.dart');
     var d = convertPath('/test/lib/d.dart');
     var e = convertPath('/test/lib/e.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
-    newFile2(c, '');
-    newFile2(d, "import 'a.dart';");
-    newFile2(e, "import 'b.dart';");
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
+    newFile(c, '');
+    newFile(d, "import 'a.dart';");
+    newFile(e, "import 'b.dart';");
 
     driver.addFile(a);
     driver.addFile(b);
@@ -3231,9 +3231,9 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
     var c = convertPath('/test/lib/c.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
-    newFile2(c, 'class C {}');
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
+    newFile(c, 'class C {}');
 
     driver.addFile(a);
     driver.addFile(b);
@@ -3264,7 +3264,7 @@
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 var v = 0;
 ''');
     driver.addFile(a);
@@ -3273,7 +3273,7 @@
     expect(allResults.singleWhere((r) => r.path == a).errors, hasLength(0));
     allResults.clear();
 
-    newFile2(a, r'''
+    newFile(a, r'''
 var v = 0
 ''');
     driver.removeFile(b);
@@ -3285,8 +3285,8 @@
   test_results_skipNotAffected() async {
     var a = convertPath('/test/lib/a.dart');
     var b = convertPath('/test/lib/b.dart');
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
 
     driver.addFile(a);
     driver.addFile(b);
diff --git a/pkg/analyzer/test/src/dart/analysis/feature_set_provider_test.dart b/pkg/analyzer/test/src/dart/analysis/feature_set_provider_test.dart
index d4c241f..8eb7d7a 100644
--- a/pkg/analyzer/test/src/dart/analysis/feature_set_provider_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/feature_set_provider_test.dart
@@ -32,7 +32,7 @@
   Folder get sdkRoot => newFolder('/sdk');
 
   void setUp() {
-    newFile2('/test/lib/test.dart', '');
+    newFile('/test/lib/test.dart', '');
 
     createMockSdk(
       resourceProvider: resourceProvider,
@@ -457,6 +457,6 @@
   }
 
   void _newSdkExperimentsFile(String content) {
-    newFile2('$sdkRoot/lib/_internal/allowed_experiments.json', content);
+    newFile('$sdkRoot/lib/_internal/allowed_experiments.json', content);
   }
 }
diff --git a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
index 7561099..7fe7d8e 100644
--- a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
@@ -47,7 +47,7 @@
     var generatedPath = convertPath('$workspaceRootPath/bazel-bin/$relPath');
 
     // This generated file should be used instead of the writable.
-    newFile2(generatedPath, '');
+    newFile(generatedPath, '');
 
     var analysisDriver = driverFor(convertPath(testFilePath));
 
@@ -75,7 +75,7 @@
     var generatedPath = convertPath('$workspaceRootPath/bazel-bin/$relPath');
 
     // This generated file should be used instead of the writable.
-    newFile2(generatedPath, '');
+    newFile(generatedPath, '');
 
     var analysisDriver = driverFor(convertPath(testFilePath));
 
@@ -186,7 +186,7 @@
 
   test_definedClassMemberNames() {
     String path = convertPath('/aaa/lib/a.dart');
-    newFile2(path, r'''
+    newFile(path, r'''
 class A {
   int a, b;
   A();
@@ -206,7 +206,7 @@
 
   test_definedClassMemberNames_enum() {
     String path = convertPath('/aaa/lib/a.dart');
-    newFile2(path, r'''
+    newFile(path, r'''
 enum E1 {
   v1;
   int field1, field2;
@@ -240,7 +240,7 @@
 
   test_definedTopLevelNames() {
     String path = convertPath('/aaa/lib/a.dart');
-    newFile2(path, r'''
+    newFile(path, r'''
 class A {}
 class B = Object with A;
 typedef C();
@@ -274,7 +274,7 @@
 
   test_getFileForPath_emptyUri() {
     String path = convertPath('/test.dart');
-    newFile2(path, r'''
+    newFile(path, r'''
 import '';
 export '';
 part '';
@@ -288,7 +288,7 @@
 
   test_getFileForPath_hasLibraryDirective_hasPartOfDirective() {
     String a = convertPath('/test/lib/a.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library L;
 part of L;
 ''');
@@ -311,7 +311,7 @@
 part 'a3.dart';
 part ':[invalid uri]';
 ''';
-    newFile2(a, content_a1);
+    newFile(a, content_a1);
 
     FileState file = fileSystemState.getFileForPath(a);
 
@@ -350,7 +350,7 @@
 
 class A1 {}
 ''';
-    newFile2(a1, content_a1);
+    newFile(a1, content_a1);
 
     FileState file = fileSystemState.getFileForPath(a1);
     expect(file.path, a1);
@@ -392,7 +392,7 @@
     String b = convertPath('/test/lib/b.dart');
     String c = convertPath('/test/lib/c.dart');
     String d = convertPath('/test/lib/d.dart');
-    newFile2(a, r'''
+    newFile(a, r'''
 library lib;
 import 'dart:math';
 import 'b.dart';
@@ -413,11 +413,11 @@
   test_getFileForPath_part() {
     String a1 = convertPath('/aaa/lib/a1.dart');
     String a2 = convertPath('/aaa/lib/a2.dart');
-    newFile2(a1, r'''
+    newFile(a1, r'''
 library a1;
 part 'a2.dart';
 ''');
-    newFile2(a2, r'''
+    newFile(a2, r'''
 part of a1;
 class A2 {}
 ''');
@@ -450,7 +450,7 @@
     // Now update the library, and refresh its file.
     // The 'a2.dart' is not referenced anymore.
     // So the part file does not have the library anymore.
-    newFile2(a1, r'''
+    newFile(a1, r'''
 library a1;
 part 'not-a2.dart';
 ''');
@@ -481,11 +481,11 @@
     String a = convertPath('/a.dart');
     String b = convertPath('/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A {}
 class B extends A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 class A {}
 class D implements A {}
 ''');
@@ -499,7 +499,7 @@
     );
 
     // Change b.dart so that it does not subtype A.
-    newFile2(b, r'''
+    newFile(b, r'''
 class C {}
 class D implements C {}
 ''');
@@ -518,13 +518,13 @@
     String a = convertPath('/a.dart');
     String b = convertPath('/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A {}
 enum E1 implements A {
   v
 }
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 class A {}
 enum E2 implements A {
   v
@@ -540,7 +540,7 @@
     );
 
     // Change b.dart so that it does not subtype A.
-    newFile2(b, r'''
+    newFile(b, r'''
 class C {}
 enum E2 implements C {
   v
@@ -561,13 +561,13 @@
     String a = convertPath('/a.dart');
     String b = convertPath('/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 mixin M {}
 enum E1 with M {
   v
 }
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 mixin M {}
 enum E2 with M {
   v
@@ -615,17 +615,17 @@
     _assertFilesWithoutLibraryCycle([]);
 
     // No imports, so just a single file.
-    newFile2(pa, '');
+    newFile(pa, '');
     _assertLibraryCycle(fa, [fa], []);
 
     // Import b.dart into a.dart, two files now.
-    newFile2(pa, "import 'b.dart';");
+    newFile(pa, "import 'b.dart';");
     fa.refresh();
     _assertFilesWithoutLibraryCycle([fa]);
     _assertLibraryCycle(fa, [fa], [fb.libraryCycle]);
 
     // Update b.dart so that it imports c.dart now.
-    newFile2(pb, "import 'c.dart';");
+    newFile(pb, "import 'c.dart';");
     fb.refresh();
     _assertFilesWithoutLibraryCycle([fa, fb]);
     _assertLibraryCycle(fa, [fa], [fb.libraryCycle]);
@@ -633,7 +633,7 @@
     _assertFilesWithoutLibraryCycle([]);
 
     // Update b.dart so that it exports d.dart instead.
-    newFile2(pb, "export 'd.dart';");
+    newFile(pb, "export 'd.dart';");
     fb.refresh();
     _assertFilesWithoutLibraryCycle([fa, fb]);
     _assertLibraryCycle(fa, [fa], [fb.libraryCycle]);
@@ -641,7 +641,7 @@
     _assertFilesWithoutLibraryCycle([]);
 
     // Update a.dart so that it does not import b.dart anymore.
-    newFile2(pa, '');
+    newFile(pa, '');
     fa.refresh();
     _assertFilesWithoutLibraryCycle([fa]);
     _assertLibraryCycle(fa, [fa], []);
@@ -651,8 +651,8 @@
     String pa = convertPath('/aaa/lib/a.dart');
     String pb = convertPath('/aaa/lib/b.dart');
 
-    newFile2(pa, "import 'b.dart';");
-    newFile2(pb, "import 'a.dart';");
+    newFile(pa, "import 'b.dart';");
+    newFile(pb, "import 'a.dart';");
 
     FileState fa = fileSystemState.getFileForPath(pa);
     FileState fb = fileSystemState.getFileForPath(pb);
@@ -668,7 +668,7 @@
     expect(fa.libraryCycle, same(fb.libraryCycle));
 
     // Update a.dart so that it does not import b.dart anymore.
-    newFile2(pa, '');
+    newFile(pa, '');
     fa.refresh();
     _assertFilesWithoutLibraryCycle([fa, fb]);
     _assertLibraryCycle(fa, [fa], []);
@@ -678,7 +678,7 @@
   test_libraryCycle_invalidPart_withPart() {
     var pa = convertPath('/aaa/lib/a.dart');
 
-    newFile2(pa, r'''
+    newFile(pa, r'''
 part of lib;
 part 'a.dart';
 ''');
@@ -692,10 +692,10 @@
     var a_path = convertPath('/aaa/lib/a.dart');
     var b_path = convertPath('/aaa/lib/b.dart');
 
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 part 'b.dart';
 ''');
-    newFile2(b_path, r'''
+    newFile(b_path, r'''
 part of 'a.dart';
 ''');
 
@@ -720,7 +720,7 @@
 
   test_referencedNames() {
     String path = convertPath('/aaa/lib/a.dart');
-    newFile2(path, r'''
+    newFile(path, r'''
 A foo(B p) {
   foo(null);
   C c = new C(p);
@@ -733,7 +733,7 @@
 
   test_refresh_differentApiSignature() {
     String path = convertPath('/aaa/lib/a.dart');
-    newFile2(path, r'''
+    newFile(path, r'''
 class A {}
 ''');
     FileState file = fileSystemState.getFileForPath(path);
@@ -741,7 +741,7 @@
     List<int> signature = file.apiSignature;
 
     // Update the resource and refresh the file state.
-    newFile2(path, r'''
+    newFile(path, r'''
 class B {}
 ''');
     bool apiSignatureChanged = file.refresh();
@@ -753,7 +753,7 @@
 
   test_refresh_sameApiSignature() {
     String path = convertPath('/aaa/lib/a.dart');
-    newFile2(path, r'''
+    newFile(path, r'''
 class C {
   foo() {
     print(111);
@@ -764,7 +764,7 @@
     List<int> signature = file.apiSignature;
 
     // Update the resource and refresh the file state.
-    newFile2(path, r'''
+    newFile(path, r'''
 class C {
   foo() {
     print(222);
@@ -779,7 +779,7 @@
 
   test_store_zeroLengthUnlinked() {
     String path = convertPath('/test.dart');
-    newFile2(path, 'class A {}');
+    newFile(path, 'class A {}');
 
     // Get the file, prepare unlinked.
     FileState file = fileSystemState.getFileForPath(path);
@@ -795,7 +795,7 @@
 
   test_subtypedNames() {
     String path = convertPath('/test.dart');
-    newFile2(path, r'''
+    newFile(path, r'''
 class X extends A {}
 class Y extends A with B {}
 class Z implements C, D {}
@@ -810,10 +810,10 @@
     String pc = convertPath('/aaa/lib/c.dart');
     String pd = convertPath('/aaa/lib/d.dart');
 
-    newFile2(pa, "class A {}");
-    newFile2(pb, "import 'a.dart';");
-    newFile2(pc, "import 'b.dart';");
-    newFile2(pd, "class D {}");
+    newFile(pa, "class A {}");
+    newFile(pb, "import 'a.dart';");
+    newFile(pc, "import 'b.dart';");
+    newFile(pd, "class D {}");
 
     FileState fa = fileSystemState.getFileForPath(pa);
     FileState fb = fileSystemState.getFileForPath(pb);
@@ -830,13 +830,13 @@
 
     // Make an update to a.dart that does not change its API signature.
     // All library cycles are still valid.
-    newFile2(pa, "class A {} // the same API signature");
+    newFile(pa, "class A {} // the same API signature");
     fa.refresh();
     _assertFilesWithoutLibraryCycle([]);
 
     // Change a.dart API signature.
     // This flushes signatures of b.dart and c.dart, but d.dart is still OK.
-    newFile2(pa, "class A2 {}");
+    newFile(pa, "class A2 {}");
     fa.refresh();
     _assertFilesWithoutLibraryCycle([fa, fb, fc]);
   }
@@ -845,10 +845,10 @@
     var aPath = convertPath('/test/lib/a.dart');
     var bPath = convertPath('/test/lib/b.dart');
 
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 part 'b.dart';
 ''');
-    newFile2(bPath, '''
+    newFile(bPath, '''
 part of 'a.dart';
 ''');
 
diff --git a/pkg/analyzer/test/src/dart/analysis/index_test.dart b/pkg/analyzer/test/src/dart/analysis/index_test.dart
index 0f5e9ad..f16ec1f 100644
--- a/pkg/analyzer/test/src/dart/analysis/index_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/index_test.dart
@@ -107,7 +107,7 @@
   }
 
   test_isExtendedBy_ClassDeclaration_isQualified() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 ''');
     await _indexTestUnit('''
@@ -152,7 +152,7 @@
   }
 
   test_isExtendedBy_ClassTypeAlias_isQualified() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 ''');
     await _indexTestUnit('''
@@ -178,7 +178,7 @@
   }
 
   test_isImplementedBy_ClassDeclaration_isQualified() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 ''');
     await _indexTestUnit('''
@@ -251,7 +251,7 @@
   }
 
   test_isInvokedBy_FunctionElement() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 foo() {}
 ''');
@@ -510,7 +510,7 @@
   }
 
   test_isMixedInBy_ClassDeclaration_isQualified() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 ''');
     await _indexTestUnit('''
@@ -674,7 +674,7 @@
   }
 
   test_isReferencedBy_ClassElement_invocation_isQualified() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 ''');
     await _indexTestUnit('''
@@ -713,7 +713,7 @@
   }
 
   test_isReferencedBy_CompilationUnitElement_export() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await _indexTestUnit('''
@@ -724,7 +724,7 @@
   }
 
   test_isReferencedBy_CompilationUnitElement_import() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await _indexTestUnit('''
@@ -735,7 +735,7 @@
   }
 
   test_isReferencedBy_CompilationUnitElement_part() async {
-    newFile2('$testPackageLibPath/my_unit.dart', 'part of my_lib;');
+    newFile('$testPackageLibPath/my_unit.dart', 'part of my_lib;');
     await _indexTestUnit('''
 library my_lib;
 part 'my_unit.dart';
@@ -745,8 +745,8 @@
   }
 
   test_isReferencedBy_CompilationUnitElement_part_inPart() async {
-    newFile2('$testPackageLibPath/a.dart', 'part of lib;');
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/a.dart', 'part of lib;');
+    newFile('$testPackageLibPath/b.dart', '''
 library lib;
 part 'a.dart';
 ''');
@@ -1227,7 +1227,7 @@
   }
 
   test_isReferencedBy_FunctionElement_with_LibraryElement() async {
-    newFile2('$testPackageLibPath/foo.dart', r'''
+    newFile('$testPackageLibPath/foo.dart', r'''
 bar() {}
 ''');
     await _indexTestUnit('''
@@ -1306,8 +1306,8 @@
   }
 
   test_isReferencedBy_MultiplyDefinedElement() async {
-    newFile2('$testPackageLibPath/a1.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a2.dart', 'class A {}');
+    newFile('$testPackageLibPath/a1.dart', 'class A {}');
+    newFile('$testPackageLibPath/a2.dart', 'class A {}');
     await _indexTestUnit('''
 import 'a1.dart';
 import 'a2.dart';
@@ -1357,10 +1357,10 @@
   }
 
   test_isReferencedBy_ParameterElement_multiplyDefined_generic() async {
-    newFile2('/test/lib/a.dart', r'''
+    newFile('/test/lib/a.dart', r'''
 void foo<T>({T? a}) {}
 ''');
-    newFile2('/test/lib/b.dart', r'''
+    newFile('/test/lib/b.dart', r'''
 void foo<T>({T? a}) {}
 ''');
     await _indexTestUnit(r"""
@@ -1563,7 +1563,7 @@
   }
 
   test_isReferencedBy_TopLevelVariableElement() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 var V;
 ''');
@@ -1587,7 +1587,7 @@
   }
 
   test_isReferencedBy_TopLevelVariableElement_synthetic_hasGetterSetter() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 int get V => 0;
 void set V(_) {}
 ''');
@@ -1599,7 +1599,7 @@
   }
 
   test_isReferencedBy_TopLevelVariableElement_synthetic_hasSetter() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 void set V(_) {}
 ''');
     await _indexTestUnit('''
@@ -1661,7 +1661,7 @@
 
   test_subtypes_classDeclaration() async {
     String libP = 'package:test/lib.dart;package:test/lib.dart';
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 class B {}
 class C {}
@@ -1711,7 +1711,7 @@
 
   test_subtypes_classTypeAlias() async {
     String libP = 'package:test/lib.dart;package:test/lib.dart';
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 class B {}
 class C {}
@@ -1779,7 +1779,7 @@
 
   test_subtypes_mixinDeclaration() async {
     String libP = 'package:test/lib.dart;package:test/lib.dart';
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 class B {}
 class C {}
diff --git a/pkg/analyzer/test/src/dart/analysis/resolve_for_completion_test.dart b/pkg/analyzer/test/src/dart/analysis/resolve_for_completion_test.dart
index 61fd0a9..a677d49 100644
--- a/pkg/analyzer/test/src/dart/analysis/resolve_for_completion_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/resolve_for_completion_test.dart
@@ -458,7 +458,7 @@
   }
 
   test_processPendingChanges() async {
-    newFile2(testFilePath, 'class A {}');
+    newFile(testFilePath, 'class A {}');
 
     // Read the file.
     testDriver.getFileSync(testFilePathPlatform);
@@ -559,7 +559,7 @@
 
     var before = content.substring(0, offset);
     var after = content.substring(offset + 1);
-    newFile2(path, before + after);
+    newFile(path, before + after);
 
     return offset;
   }
diff --git a/pkg/analyzer/test/src/dart/analysis/results/get_element_declaration_test.dart b/pkg/analyzer/test/src/dart/analysis/results/get_element_declaration_test.dart
index 5d1a963..c34e500 100644
--- a/pkg/analyzer/test/src/dart/analysis/results/get_element_declaration_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/results/get_element_declaration_test.dart
@@ -59,7 +59,7 @@
   }
 
   test_class_inPart() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 part of 'test.dart';
 class A {}
 ''');
diff --git a/pkg/analyzer/test/src/dart/analysis/search_test.dart b/pkg/analyzer/test/src/dart/analysis/search_test.dart
index fc3afd1..ba431f2 100644
--- a/pkg/analyzer/test/src/dart/analysis/search_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/search_test.dart
@@ -200,9 +200,9 @@
         ..add(name: 'bbb', rootPath: bbbPackageRootPath),
     );
 
-    newFile2(aaaFilePath, 'class A {}');
-    newFile2(bbbFilePath, 'class B {}');
-    newFile2(cccFilePath, 'class C {}');
+    newFile(aaaFilePath, 'class A {}');
+    newFile(bbbFilePath, 'class B {}');
+    newFile(cccFilePath, 'class C {}');
 
     await resolveTestCode('class T {}');
 
@@ -297,8 +297,8 @@
   }
 
   test_declarations_onlyForFile() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
-    var b = newFile2('$testPackageLibPath/b.dart', 'class B {}').path;
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
+    var b = newFile('$testPackageLibPath/b.dart', 'class B {}').path;
 
     var results = WorkspaceSymbols();
     await driver.search.declarations(results, null, null, onlyForFile: b);
@@ -570,7 +570,7 @@
   }
 
   test_searchReferences_ClassElement_definedOutside() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 class A {};
 ''');
     await resolveTestCode('''
@@ -645,7 +645,7 @@
   }
 
   test_searchReferences_CompilationUnitElement() async {
-    newFile2('$testPackageLibPath/foo.dart', '');
+    newFile('$testPackageLibPath/foo.dart', '');
     await resolveTestCode('''
 import 'foo.dart'; // import
 export 'foo.dart'; // export
@@ -779,7 +779,7 @@
   A(); // in other
 }
 ''';
-    newFile2(other, otherCode);
+    newFile(other, otherCode);
 
     await resolveTestCode('''
 class A {
@@ -1145,7 +1145,7 @@
   }
 
   test_searchReferences_ImportElement_noPrefix_optIn_fromOptOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class N1 {}
 void N2() {}
 int get N3 => 0;
@@ -1229,7 +1229,7 @@
   }
 
   test_searchReferences_ImportElement_withPrefix_optIn_fromOptOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class N1 {}
 void N2() {}
 int get N3 => 0;
@@ -1284,8 +1284,8 @@
   test_searchReferences_LibraryElement() async {
     var codeA = 'part of lib; // A';
     var codeB = 'part of lib; // B';
-    newFile2('$testPackageLibPath/unitA.dart', codeA);
-    newFile2('$testPackageLibPath/unitB.dart', codeB);
+    newFile('$testPackageLibPath/unitA.dart', codeA);
+    newFile('$testPackageLibPath/unitB.dart', codeB);
     await resolveTestCode('''
 library lib;
 part 'unitA.dart';
@@ -1317,8 +1317,8 @@
 
     var codeA = 'part of lib; // A';
     var codeB = 'part of lib; // B';
-    newFile2(partPathA, codeA);
-    newFile2(partPathB, codeB);
+    newFile(partPathA, codeA);
+    newFile(partPathB, codeB);
 
     pathForContextSelection = testFilePath;
 
@@ -1831,7 +1831,7 @@
 part of my_lib;
 ppp.Future c;
 ''';
-    newFile2('$testPackageLibPath/my_part.dart', partCode);
+    newFile('$testPackageLibPath/my_part.dart', partCode);
     await resolveTestCode('''
 library my_lib;
 import 'dart:async' as ppp;
@@ -1870,7 +1870,7 @@
 part of my_lib;
 ppp.Future c;
 ''';
-    newFile2(partPath, partCode);
+    newFile(partPath, partCode);
     await resolveFileCode(libPath, '''
 library my_lib;
 import 'dart:async' as ppp;
@@ -1898,9 +1898,9 @@
     String p3 = convertPath('$testPackageLibPath/part3.dart');
     String code1 = 'part of lib; _C v1;';
     String code2 = 'part of lib; _C v2;';
-    newFile2(p1, code1);
-    newFile2(p2, code2);
-    newFile2(p3, 'part of lib; int v3;');
+    newFile(p1, code1);
+    newFile(p2, code2);
+    newFile(p3, 'part of lib; int v3;');
 
     await resolveTestCode('''
 library lib;
@@ -1942,9 +1942,9 @@
 ''';
     String code2 = 'part of lib; _C v2;';
 
-    newFile2(p, code);
-    newFile2(p1, code1);
-    newFile2(p2, code2);
+    newFile(p, code);
+    newFile(p1, code1);
+    newFile(p2, code2);
 
     await resolveTestCode(code);
 
@@ -1985,8 +1985,8 @@
     String code1 = 'part of lib; _C v1;';
     String code2 = 'part of lib; _C v2;';
 
-    newFile2(p1, code1);
-    newFile2(p2, code2);
+    newFile(p1, code1);
+    newFile(p2, code2);
 
     await resolveFileCode(testFile, testCode);
 
@@ -2104,7 +2104,7 @@
   }
 
   test_searchReferences_TopLevelVariableElement() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 var V;
 ''');
@@ -2170,7 +2170,7 @@
   }
 
   test_searchReferences_TypeAliasElement_fromLegacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef A<T> = Map<int, T>;
 ''');
     await resolveTestCode('''
@@ -2403,7 +2403,7 @@
     var aUri = 'package:aaa/a.dart';
     var bUri = 'package:bbb/b.dart';
 
-    newFile2(testFilePath, r'''
+    newFile(testFilePath, r'''
 import 'package:aaa/a.dart';
 
 class T1 extends A {
@@ -2415,7 +2415,7 @@
 }
 ''');
 
-    newFile2(bbbFilePath, r'''
+    newFile(bbbFilePath, r'''
 import 'package:aaa/a.dart';
 
 class B extends A {
@@ -2423,7 +2423,7 @@
 }
 ''');
 
-    newFile2(aaaFilePath, r'''
+    newFile(aaaFilePath, r'''
 class A {
   void method1() {}
   void method2() {}
@@ -2471,10 +2471,10 @@
         ..add(name: 'bbb', rootPath: bbbPackageRootPath),
     );
 
-    newFile2(testFilePath, 'class T implements List {}');
-    newFile2(aaaFilePath, 'class A implements List {}');
-    newFile2(bbbFilePath, 'class B implements List {}');
-    newFile2(cccFilePath, 'class C implements List {}');
+    newFile(testFilePath, 'class T implements List {}');
+    newFile(aaaFilePath, 'class A implements List {}');
+    newFile(bbbFilePath, 'class B implements List {}');
+    newFile(cccFilePath, 'class C implements List {}');
 
     var coreLibResult =
         await driver.getLibraryByUri('dart:core') as LibraryElementResult;
@@ -2500,11 +2500,11 @@
   test_subtypes_class_files() async {
     String pathB = convertPath('$testPackageLibPath/b.dart');
     String pathC = convertPath('$testPackageLibPath/c.dart');
-    newFile2(pathB, r'''
+    newFile(pathB, r'''
 import 'test.dart';
 class B extends A {}
 ''');
-    newFile2(pathC, r'''
+    newFile(pathC, r'''
 import 'test.dart';
 class C extends A {}
 class D {}
diff --git a/pkg/analyzer/test/src/dart/analysis/session_helper_test.dart b/pkg/analyzer/test/src/dart/analysis/session_helper_test.dart
index 46131f0..f03c5fa 100644
--- a/pkg/analyzer/test/src/dart/analysis/session_helper_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/session_helper_test.dart
@@ -28,7 +28,7 @@
   }
 
   test_getClass_defined() async {
-    var file = newFile2('$testPackageLibPath/c.dart', r'''
+    var file = newFile('$testPackageLibPath/c.dart', r'''
 class C {}
 int v = 0;
 ''');
@@ -39,7 +39,7 @@
   }
 
   test_getClass_defined_notClass() async {
-    var file = newFile2('$testPackageLibPath/c.dart', r'''
+    var file = newFile('$testPackageLibPath/c.dart', r'''
 int v = 0;
 ''');
     String uri = file.toUri().toString();
@@ -49,10 +49,10 @@
   }
 
   test_getClass_exported() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
-    var bFile = newFile2('$testPackageLibPath/b.dart', r'''
+    var bFile = newFile('$testPackageLibPath/b.dart', r'''
 export 'a.dart';
 ''');
     String bUri = bFile.toUri().toString();
@@ -62,10 +62,10 @@
   }
 
   test_getClass_imported() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
-    var bFile = newFile2('$testPackageLibPath/b.dart', r'''
+    var bFile = newFile('$testPackageLibPath/b.dart', r'''
 import 'a.dart';
 ''');
     String bUri = bFile.toUri().toString();
@@ -95,7 +95,7 @@
   }
 
   test_getTopLevelPropertyAccessor_defined_getter() async {
-    var file = newFile2('$testPackageLibPath/test.dart', r'''
+    var file = newFile('$testPackageLibPath/test.dart', r'''
 int get a => 0;
 ''');
     String uri = file.toUri().toString();
@@ -106,7 +106,7 @@
   }
 
   test_getTopLevelPropertyAccessor_defined_setter() async {
-    var file = newFile2('$testPackageLibPath/test.dart', r'''
+    var file = newFile('$testPackageLibPath/test.dart', r'''
 set a(_) {}
 ''');
     String uri = file.toUri().toString();
@@ -117,7 +117,7 @@
   }
 
   test_getTopLevelPropertyAccessor_defined_variable() async {
-    var file = newFile2('$testPackageLibPath/test.dart', r'''
+    var file = newFile('$testPackageLibPath/test.dart', r'''
 int a;
 ''');
     String uri = file.toUri().toString();
@@ -128,10 +128,10 @@
   }
 
   test_getTopLevelPropertyAccessor_exported() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int a;
 ''');
-    var bFile = newFile2('$testPackageLibPath/b.dart', r'''
+    var bFile = newFile('$testPackageLibPath/b.dart', r'''
 export 'a.dart';
 ''');
     String bUri = bFile.toUri().toString();
@@ -142,10 +142,10 @@
   }
 
   test_getTopLevelPropertyAccessor_imported() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int a;
 ''');
-    var bFile = newFile2('$testPackageLibPath/b.dart', r'''
+    var bFile = newFile('$testPackageLibPath/b.dart', r'''
 import 'a.dart';
 ''');
     String bUri = bFile.toUri().toString();
@@ -155,7 +155,7 @@
   }
 
   test_getTopLevelPropertyAccessor_notDefined() async {
-    var file = newFile2('$testPackageLibPath/test.dart', r'''
+    var file = newFile('$testPackageLibPath/test.dart', r'''
 int a;
 ''');
     String uri = file.toUri().toString();
@@ -165,7 +165,7 @@
   }
 
   test_getTopLevelPropertyAccessor_notPropertyAccessor() async {
-    var file = newFile2('$testPackageLibPath/test.dart', r'''
+    var file = newFile('$testPackageLibPath/test.dart', r'''
 int a() {}
 ''');
     String uri = file.toUri().toString();
diff --git a/pkg/analyzer/test/src/dart/analysis/session_test.dart b/pkg/analyzer/test/src/dart/analysis/session_test.dart
index fac7f1f..fd95452 100644
--- a/pkg/analyzer/test/src/dart/analysis/session_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/session_test.dart
@@ -23,7 +23,7 @@
     extends BazelWorkspaceResolutionTest {
   void test_getErrors_notFileOfUri() async {
     var relPath = 'dart/my/lib/a.dart';
-    newFile2('$workspaceRootPath/bazel-bin/$relPath', '');
+    newFile('$workspaceRootPath/bazel-bin/$relPath', '');
 
     var path = convertPath('$workspaceRootPath/$relPath');
     var session = contextFor(path).currentSession;
@@ -32,7 +32,7 @@
   }
 
   void test_getErrors_valid() async {
-    var file = newFile2(
+    var file = newFile(
       '$workspaceRootPath/dart/my/lib/a.dart',
       'var x = 0',
     );
@@ -46,7 +46,7 @@
 
   void test_getParsedLibrary_notFileOfUri() async {
     var relPath = 'dart/my/lib/a.dart';
-    newFile2('$workspaceRootPath/bazel-bin/$relPath', '');
+    newFile('$workspaceRootPath/bazel-bin/$relPath', '');
 
     var path = convertPath('$workspaceRootPath/$relPath');
     var session = contextFor(path).currentSession;
@@ -56,7 +56,7 @@
 
   void test_getResolvedLibrary_notFileOfUri() async {
     var relPath = 'dart/my/lib/a.dart';
-    newFile2('$workspaceRootPath/bazel-bin/$relPath', '');
+    newFile('$workspaceRootPath/bazel-bin/$relPath', '');
 
     var path = convertPath('$workspaceRootPath/$relPath');
     var session = contextFor(path).currentSession;
@@ -66,7 +66,7 @@
 
   void test_getResolvedUnit_notFileOfUri() async {
     var relPath = 'dart/my/lib/a.dart';
-    newFile2('$workspaceRootPath/bazel-bin/$relPath', '');
+    newFile('$workspaceRootPath/bazel-bin/$relPath', '');
 
     var path = convertPath('$workspaceRootPath/$relPath');
     var session = contextFor(path).currentSession;
@@ -75,7 +75,7 @@
   }
 
   void test_getResolvedUnit_valid() async {
-    var file = newFile2(
+    var file = newFile(
       '$workspaceRootPath/dart/my/lib/a.dart',
       'class A {}',
     );
@@ -88,7 +88,7 @@
   }
 
   void test_getUnitElement_invalidPath_notAbsolute() async {
-    var file = newFile2(
+    var file = newFile(
       '$workspaceRootPath/dart/my/lib/a.dart',
       'class A {}',
     );
@@ -100,7 +100,7 @@
 
   void test_getUnitElement_notPathOfUri() async {
     var relPath = 'dart/my/lib/a.dart';
-    newFile2('$workspaceRootPath/bazel-bin/$relPath', '');
+    newFile('$workspaceRootPath/bazel-bin/$relPath', '');
 
     var path = convertPath('$workspaceRootPath/$relPath');
     var session = contextFor(path).currentSession;
@@ -109,7 +109,7 @@
   }
 
   void test_getUnitElement_valid() async {
-    var file = newFile2(
+    var file = newFile(
       '$workspaceRootPath/dart/my/lib/a.dart',
       'class A {}',
     );
@@ -125,7 +125,7 @@
 @reflectiveTest
 class AnalysisSessionImplTest extends PubPackageResolutionTest {
   test_getErrors() async {
-    var test = newFile2(testFilePath, 'class C {');
+    var test = newFile(testFilePath, 'class C {');
 
     var session = contextFor(testFilePath).currentSession;
     var errorsResult = await session.getErrorsValid(test.path);
@@ -135,7 +135,7 @@
   }
 
   test_getErrors_inconsistent() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
     var session = contextFor(test.path).currentSession;
     driverFor(test.path).changeFile(test.path);
     expect(
@@ -151,7 +151,7 @@
   }
 
   test_getFile_inconsistent() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
     var session = contextFor(test.path).currentSession;
     driverFor(test.path).changeFile(test.path);
     expect(
@@ -167,7 +167,7 @@
   }
 
   test_getFile_library() async {
-    var a = newFile2('$testPackageLibPath/a.dart', '');
+    var a = newFile('$testPackageLibPath/a.dart', '');
 
     var session = contextFor(testFilePath).currentSession;
     var file = session.getFileValid(a.path);
@@ -177,7 +177,7 @@
   }
 
   test_getFile_part() async {
-    var a = newFile2('$testPackageLibPath/a.dart', 'part of lib;');
+    var a = newFile('$testPackageLibPath/a.dart', 'part of lib;');
 
     var session = contextFor(testFilePath).currentSession;
     var file = session.getFileValid(a.path);
@@ -187,7 +187,7 @@
   }
 
   test_getLibraryByUri() async {
-    newFile2(testFilePath, r'''
+    newFile(testFilePath, r'''
 class A {}
 class B {}
 ''');
@@ -201,7 +201,7 @@
   }
 
   test_getLibraryByUri_inconsistent() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
     var session = contextFor(test.path).currentSession;
     driverFor(test.path).changeFile(test.path);
     expect(
@@ -217,7 +217,7 @@
   }
 
   test_getParsedLibrary() async {
-    var test = newFile2('$testPackageLibPath/a.dart', r'''
+    var test = newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 class B {}
 ''');
@@ -237,7 +237,7 @@
   }
 
   test_getParsedLibrary_getElementDeclaration_class() async {
-    var test = newFile2(testFilePath, r'''
+    var test = newFile(testFilePath, r'''
 class A {}
 class B {}
 ''');
@@ -257,7 +257,7 @@
   }
 
   test_getParsedLibrary_getElementDeclaration_notThisLibrary() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
 
     var session = contextFor(testFilePath).currentSession;
     var resolvedUnit =
@@ -273,7 +273,7 @@
   }
 
   test_getParsedLibrary_getElementDeclaration_synthetic() async {
-    var test = newFile2(testFilePath, r'''
+    var test = newFile(testFilePath, r'''
 int foo = 0;
 ''');
 
@@ -298,7 +298,7 @@
   }
 
   test_getParsedLibrary_inconsistent() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
     var session = contextFor(test.path).currentSession;
     driverFor(test.path).changeFile(test.path);
     expect(
@@ -308,7 +308,7 @@
   }
 
   test_getParsedLibrary_invalidPartUri() async {
-    var test = newFile2(testFilePath, r'''
+    var test = newFile(testFilePath, r'''
 part 'a.dart';
 part ':[invalid uri].dart';
 part 'c.dart';
@@ -339,7 +339,7 @@
   }
 
   test_getParsedLibrary_notLibrary() async {
-    var test = newFile2(testFilePath, 'part of "a.dart";');
+    var test = newFile(testFilePath, 'part of "a.dart";');
     var session = contextFor(testFilePath).currentSession;
     expect(session.getParsedLibrary(test.path), isA<NotLibraryButPartResult>());
   }
@@ -367,9 +367,9 @@
 class C3 {}
 ''';
 
-    var a = newFile2('$testPackageLibPath/a.dart', aContent);
-    var b = newFile2('$testPackageLibPath/b.dart', bContent);
-    var c = newFile2('$testPackageLibPath/c.dart', cContent);
+    var a = newFile('$testPackageLibPath/a.dart', aContent);
+    var b = newFile('$testPackageLibPath/b.dart', bContent);
+    var c = newFile('$testPackageLibPath/c.dart', cContent);
 
     var session = contextFor(testFilePath).currentSession;
     var parsedLibrary = session.getParsedLibraryValid(a.path);
@@ -398,7 +398,7 @@
   }
 
   test_getParsedLibraryByElement() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
 
     var session = contextFor(testFilePath).currentSession;
     var libraryResult = await session.getLibraryByUriValid(
@@ -419,7 +419,7 @@
   }
 
   test_getParsedLibraryByElement_differentSession() async {
-    newFile2(testFilePath, '');
+    newFile(testFilePath, '');
 
     var session = contextFor(testFilePath).currentSession;
     var libraryResult = await session.getLibraryByUriValid(
@@ -434,7 +434,7 @@
   }
 
   test_getParsedUnit() async {
-    var test = newFile2(testFilePath, r'''
+    var test = newFile(testFilePath, r'''
 class A {}
 class B {}
 ''');
@@ -448,7 +448,7 @@
   }
 
   test_getParsedUnit_inconsistent() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
     var session = contextFor(test.path).currentSession;
     driverFor(test.path).changeFile(test.path);
     expect(
@@ -469,7 +469,7 @@
 
 class A /*a*/ {}
 ''';
-    var a = newFile2('$testPackageLibPath/a.dart', aContent);
+    var a = newFile('$testPackageLibPath/a.dart', aContent);
 
     var bContent = r'''
 part of 'a.dart';
@@ -477,7 +477,7 @@
 class B /*b*/ {}
 class B2 extends X {}
 ''';
-    var b = newFile2('$testPackageLibPath/b.dart', bContent);
+    var b = newFile('$testPackageLibPath/b.dart', bContent);
 
     var session = contextFor(testFilePath).currentSession;
     var resolvedLibrary = await session.getResolvedLibraryValid(a.path);
@@ -526,7 +526,7 @@
   }
 
   test_getResolvedLibrary_getElementDeclaration_notThisLibrary() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
 
     var session = contextFor(testFilePath).currentSession;
     var resolvedLibrary = await session.getResolvedLibraryValid(test.path);
@@ -538,7 +538,7 @@
   }
 
   test_getResolvedLibrary_getElementDeclaration_synthetic() async {
-    var test = newFile2(testFilePath, r'''
+    var test = newFile(testFilePath, r'''
 int foo = 0;
 ''');
 
@@ -563,7 +563,7 @@
   }
 
   test_getResolvedLibrary_inconsistent() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
     var session = contextFor(test.path).currentSession;
     driverFor(test.path).changeFile(test.path);
     expect(
@@ -573,7 +573,7 @@
   }
 
   test_getResolvedLibrary_invalidPartUri() async {
-    var test = newFile2(testFilePath, r'''
+    var test = newFile(testFilePath, r'''
 part 'a.dart';
 part ':[invalid uri].dart';
 part 'c.dart';
@@ -604,7 +604,7 @@
   }
 
   test_getResolvedLibrary_notLibrary() async {
-    var test = newFile2(testFilePath, 'part of "a.dart";');
+    var test = newFile(testFilePath, 'part of "a.dart";');
 
     var session = contextFor(testFilePath).currentSession;
     var result = await session.getResolvedLibrary(test.path);
@@ -612,7 +612,7 @@
   }
 
   test_getResolvedLibraryByElement() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
 
     var session = contextFor(testFilePath).currentSession;
     var libraryResult = await session.getLibraryByUriValid(
@@ -629,7 +629,7 @@
   }
 
   test_getResolvedLibraryByElement_differentSession() async {
-    newFile2(testFilePath, '');
+    newFile(testFilePath, '');
 
     var session = contextFor(testFilePath).currentSession;
     var libraryResult = await session.getLibraryByUriValid(
@@ -644,7 +644,7 @@
   }
 
   test_getResolvedUnit() async {
-    var test = newFile2(testFilePath, r'''
+    var test = newFile(testFilePath, r'''
 class A {}
 class B {}
 ''');
@@ -661,7 +661,7 @@
   }
 
   test_getResolvedUnit_inconsistent() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
     var session = contextFor(test.path).currentSession;
     driverFor(test.path).changeFile(test.path);
     expect(
@@ -671,7 +671,7 @@
   }
 
   test_getUnitElement() async {
-    var test = newFile2(testFilePath, r'''
+    var test = newFile(testFilePath, r'''
 class A {}
 class B {}
 ''');
@@ -685,7 +685,7 @@
   }
 
   test_getUnitElement_inconsistent() async {
-    var test = newFile2(testFilePath, '');
+    var test = newFile(testFilePath, '');
     var session = contextFor(test.path).currentSession;
     driverFor(test.path).changeFile(test.path);
     expect(
diff --git a/pkg/analyzer/test/src/dart/analysis/unlinked_api_signature_test.dart b/pkg/analyzer/test/src/dart/analysis/unlinked_api_signature_test.dart
index adcb920..21157c3 100644
--- a/pkg/analyzer/test/src/dart/analysis/unlinked_api_signature_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/unlinked_api_signature_test.dart
@@ -1393,11 +1393,11 @@
   void _assertSignature(String oldCode, String newCode, {required bool same}) {
     var path = convertPath('/test.dart');
 
-    newFile2(path, oldCode);
+    newFile(path, oldCode);
     var oldUnit = parseUnit(path).unit;
     var oldSignature = computeUnlinkedApiSignature(oldUnit);
 
-    newFile2(path, newCode);
+    newFile(path, newCode);
     var newUnit = parseUnit(path).unit;
     var newSignature = computeUnlinkedApiSignature(newUnit);
 
diff --git a/pkg/analyzer/test/src/dart/ast/ast_test.dart b/pkg/analyzer/test/src/dart/ast/ast_test.dart
index efd2a34..e3fa25c 100644
--- a/pkg/analyzer/test/src/dart/ast/ast_test.dart
+++ b/pkg/analyzer/test/src/dart/ast/ast_test.dart
@@ -615,7 +615,7 @@
   }
 
   test_isConst_notInContext_constructor_const_generic_named_prefixed() async {
-    newFile2('$testPackageLibPath/c.dart', '''
+    newFile('$testPackageLibPath/c.dart', '''
 class C<E> {
   const C.n();
 }
@@ -638,7 +638,7 @@
   }
 
   test_isConst_notInContext_constructor_const_generic_unnamed_prefixed() async {
-    newFile2('$testPackageLibPath/c.dart', '''
+    newFile('$testPackageLibPath/c.dart', '''
 class C<E> {
   const C();
 }
@@ -689,7 +689,7 @@
   }
 
   test_isConst_notInContext_constructor_const_nonGeneric_named_prefixed() async {
-    newFile2('$testPackageLibPath/c.dart', '''
+    newFile('$testPackageLibPath/c.dart', '''
 class C {
   const C.n();
 }
@@ -712,7 +712,7 @@
   }
 
   test_isConst_notInContext_constructor_const_nonGeneric_unnamed_prefixed() async {
-    newFile2('$testPackageLibPath/c.dart', '''
+    newFile('$testPackageLibPath/c.dart', '''
 class C {
   const C();
 }
diff --git a/pkg/analyzer/test/src/dart/ast/constant_evaluator_test.dart b/pkg/analyzer/test/src/dart/ast/constant_evaluator_test.dart
index 5dd2c78..d16e36f 100644
--- a/pkg/analyzer/test/src/dart/ast/constant_evaluator_test.dart
+++ b/pkg/analyzer/test/src/dart/ast/constant_evaluator_test.dart
@@ -339,7 +339,7 @@
   Object? _getConstantValue(String expressionCode) {
     var path = convertPath('/test/lib/test.dart');
 
-    newFile2(path, '''
+    newFile(path, '''
 void f() {
   ($expressionCode); // ref
 }
diff --git a/pkg/analyzer/test/src/dart/ast/element_locator_test.dart b/pkg/analyzer/test/src/dart/ast/element_locator_test.dart
index 2c0abd8..ab8a0dd 100644
--- a/pkg/analyzer/test/src/dart/ast/element_locator_test.dart
+++ b/pkg/analyzer/test/src/dart/ast/element_locator_test.dart
@@ -204,7 +204,7 @@
   }
 
   test_locate_InstanceCreationExpression_type_prefixedIdentifier() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
     await resolveTestCode(r'''
@@ -220,7 +220,7 @@
   }
 
   test_locate_InstanceCreationExpression_type_simpleIdentifier() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 ''');
     await resolveTestCode(r'''
 class A {}
@@ -284,12 +284,12 @@
     var libPath = convertPath('$testPackageLibPath/lib.dart');
     var partPath = convertPath('$testPackageLibPath/test.dart');
 
-    newFile2(libPath, r'''
+    newFile(libPath, r'''
 library my.lib;
 part 'test.dart';
 ''');
 
-    newFile2(partPath, r'''
+    newFile(partPath, r'''
 part of my.lib;
 ''');
 
@@ -326,7 +326,7 @@
   }
 
   test_locate_StringLiteral_exportUri() async {
-    newFile2("$testPackageLibPath/foo.dart", '');
+    newFile("$testPackageLibPath/foo.dart", '');
     await resolveTestCode("export 'foo.dart';");
     var node = findNode.stringLiteral('foo.dart');
     var element = ElementLocator.locate(node);
@@ -341,7 +341,7 @@
   }
 
   test_locate_StringLiteral_importUri() async {
-    newFile2("$testPackageLibPath/foo.dart", '');
+    newFile("$testPackageLibPath/foo.dart", '');
     await resolveTestCode("import 'foo.dart';");
     var node = findNode.stringLiteral('foo.dart');
     var element = ElementLocator.locate(node);
@@ -349,7 +349,7 @@
   }
 
   test_locate_StringLiteral_partUri() async {
-    newFile2("$testPackageLibPath/foo.dart", 'part of lib;');
+    newFile("$testPackageLibPath/foo.dart", 'part of lib;');
     await resolveTestCode('''
 library lib;
 
diff --git a/pkg/analyzer/test/src/dart/constant/potentially_constant_test.dart b/pkg/analyzer/test/src/dart/constant/potentially_constant_test.dart
index b86f22b..2b32a30 100644
--- a/pkg/analyzer/test/src/dart/constant/potentially_constant_test.dart
+++ b/pkg/analyzer/test/src/dart/constant/potentially_constant_test.dart
@@ -25,7 +25,7 @@
   }
 
   test_class_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
     await _assertConst(r'''
@@ -35,7 +35,7 @@
   }
 
   test_class_prefix_deferred() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
     await _assertNeverConst(r'''
@@ -805,7 +805,7 @@
   }
 
   test_prefixedIdentifier_importPrefix_deferred() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const a = 0;
 ''');
     await _assertNotConst(r'''
@@ -815,7 +815,7 @@
   }
 
   test_prefixedIdentifier_importPrefix_function() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void f() {}
 ''');
     await _assertConst(r'''
@@ -825,7 +825,7 @@
   }
 
   test_prefixedIdentifier_importPrefix_topVar() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const a = 0;
 ''');
     await _assertConst(r'''
@@ -920,7 +920,7 @@
   }
 
   test_prefixedIdentifier_typedef_interfaceType() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef A = List<int>;
 ''');
     await _assertConst(r'''
@@ -978,7 +978,7 @@
   }
 
   test_propertyAccess_staticField_withPrefix_const() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static const a = 0;
 }
@@ -990,7 +990,7 @@
   }
 
   test_propertyAccess_staticField_withPrefix_deferred() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static const a = 0;
 }
@@ -1002,7 +1002,7 @@
   }
 
   test_propertyAccess_staticField_withPrefix_final() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static final a = 0;
 }
@@ -1024,7 +1024,7 @@
   }
 
   test_propertyAccess_target_variable() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   final a = 0;
   const A();
diff --git a/pkg/analyzer/test/src/dart/element/class_element_test.dart b/pkg/analyzer/test/src/dart/element/class_element_test.dart
index 6562a8c..744578e 100644
--- a/pkg/analyzer/test/src/dart/element/class_element_test.dart
+++ b/pkg/analyzer/test/src/dart/element/class_element_test.dart
@@ -174,7 +174,7 @@
   }
 
   test_lookUpInheritedConcreteGetter_declared_hasExtends_private_otherLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int get _foo => 0;
 }
@@ -478,7 +478,7 @@
   }
 
   test_lookUpInheritedConcreteMethod_declared_hasExtends_private_otherLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo() {}
 }
@@ -782,7 +782,7 @@
   }
 
   test_lookUpInheritedConcreteSetter_declared_hasExtends_private_otherLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   set _foo(int _) {}
 }
@@ -1086,7 +1086,7 @@
   }
 
   test_lookUpInheritedMethod_declared_hasExtends_private_otherLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo() {}
 }
diff --git a/pkg/analyzer/test/src/dart/element/element_test.dart b/pkg/analyzer/test/src/dart/element/element_test.dart
index 4aab65c..aaeb60b 100644
--- a/pkg/analyzer/test/src/dart/element/element_test.dart
+++ b/pkg/analyzer/test/src/dart/element/element_test.dart
@@ -488,7 +488,7 @@
 @reflectiveTest
 class ElementAnnotationImplTest extends PubPackageResolutionTest {
   test_computeConstantValue() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   final String f;
   const A(this.f);
@@ -1356,7 +1356,7 @@
 @reflectiveTest
 class TopLevelVariableElementImplTest extends PubPackageResolutionTest {
   test_computeConstantValue() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const int C = 42;
 ''');
     await resolveTestCode(r'''
diff --git a/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart b/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart
index 5410feb..4840c69 100644
--- a/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart
+++ b/pkg/analyzer/test/src/dart/element/inheritance_manager3_test.dart
@@ -19,7 +19,7 @@
 @reflectiveTest
 class InheritanceManager3Test extends _InheritanceManager3Base {
   test_getInheritedMap_topMerge_method() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.6
 class A {
   void foo({int a}) {}
@@ -69,7 +69,7 @@
   }
 
   test_getMember_optIn_inheritsOptIn() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo(int a, int? b) => 0;
 }
@@ -93,7 +93,7 @@
   }
 
   test_getMember_optIn_inheritsOptOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.6
 class A {
   int foo(int a, int b) => 0;
@@ -218,7 +218,7 @@
   }
 
   test_getMember_optOut_inheritsOptIn() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo(int a, int? b) => 0;
 }
@@ -244,7 +244,7 @@
   }
 
   test_getMember_optOut_mixesOptIn() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo(int a, int? b) => 0;
 }
@@ -269,12 +269,12 @@
   }
 
   test_getMember_optOut_passOptIn() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo(int a, int? b) => 0;
 }
 ''');
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 // @dart = 2.6
 import 'a.dart';
 class B extends A {
diff --git a/pkg/analyzer/test/src/dart/micro/file_resolution.dart b/pkg/analyzer/test/src/dart/micro/file_resolution.dart
index 57c9d56..51c7429 100644
--- a/pkg/analyzer/test/src/dart/micro/file_resolution.dart
+++ b/pkg/analyzer/test/src/dart/micro/file_resolution.dart
@@ -37,7 +37,7 @@
 
   @override
   void addTestFile(String content) {
-    newFile2(_testFile, content);
+    newFile(_testFile, content);
   }
 
   /// Create a new [FileResolver] into [fileResolver].
@@ -100,8 +100,8 @@
       root: sdkRoot,
     );
 
-    newFile2('/workspace/WORKSPACE', '');
-    newFile2('/workspace/dart/test/BUILD', r'''
+    newFile('/workspace/WORKSPACE', '');
+    newFile('/workspace/dart/test/BUILD', r'''
 dart_package(
   null_safety = True,
 )
diff --git a/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart b/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart
index 7319323..700d107 100644
--- a/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart
+++ b/pkg/analyzer/test/src/dart/micro/simple_file_resolver_test.dart
@@ -38,15 +38,15 @@
   }
 
   test_changeFile_refreshedFiles() async {
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {}
 ''');
 
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 class B {}
 ''');
 
-    newFile2(cPath, r'''
+    newFile(cPath, r'''
 import 'a.dart';
 import 'b.dart';
 ''');
@@ -70,11 +70,11 @@
   }
 
   test_changeFile_resolution() async {
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {}
 ''');
 
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 void f(A a, B b) {}
 ''');
@@ -84,7 +84,7 @@
       error(CompileTimeErrorCode.UNDEFINED_CLASS, 29, 1),
     ]);
 
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {}
 class B {}
 ''');
@@ -95,13 +95,13 @@
   }
 
   test_changeFile_resolution_flushInheritanceManager() async {
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {
   final int foo = 0;
 }
 ''');
 
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 
 void f(A a) {
@@ -114,7 +114,7 @@
       error(CompileTimeErrorCode.ASSIGNMENT_TO_FINAL, 36, 3),
     ]);
 
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {
   int foo = 0;
 }
@@ -126,7 +126,7 @@
   }
 
   test_changeFile_resolution_missingChangeFileForPart() async {
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 part 'b.dart';
 
 var b = B(0);
@@ -140,7 +140,7 @@
 
     // Update a.dart, and notify the resolver. We need this to have at least
     // one change, so that we decided to rebuild the library summary.
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 part 'b.dart';
 
 var b = B(1);
@@ -149,7 +149,7 @@
 
     // Update b.dart, but do not notify the resolver.
     // If we try to read it now, it will throw.
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 part of 'a.dart';
 
 class B {
@@ -168,19 +168,19 @@
   }
 
   test_changePartFile_refreshedFiles() async {
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 part 'b.dart';
 
 class A {}
 ''');
 
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 part of 'a.dart';
 
 class B extends A {}
 ''');
 
-    newFile2(cPath, r'''
+    newFile(cPath, r'''
 import 'a.dart';
 ''');
 
@@ -224,7 +224,7 @@
   bool get isNullSafetyEnabled => true;
 
   test_analysisOptions_default_fromPackageUri() async {
-    newFile2('/workspace/dart/analysis_options/lib/default.yaml', r'''
+    newFile('/workspace/dart/analysis_options/lib/default.yaml', r'''
 analyzer:
   strong-mode:
     implicit-casts: false
@@ -254,7 +254,7 @@
   }
 
   test_analysisOptions_file_inThirdParty() async {
-    newFile2('/workspace/dart/analysis_options/lib/third_party.yaml', r'''
+    newFile('/workspace/dart/analysis_options/lib/third_party.yaml', r'''
 analyzer:
   strong-mode:
     implicit-casts: false
@@ -276,7 +276,7 @@
   }
 
   test_analysisOptions_file_inThirdPartyDartLang() async {
-    newFile2('/workspace/dart/analysis_options/lib/third_party.yaml', r'''
+    newFile('/workspace/dart/analysis_options/lib/third_party.yaml', r'''
 analyzer:
   strong-mode:
     implicit-casts: false
@@ -298,7 +298,7 @@
   }
 
   test_analysisOptions_lints() async {
-    newFile2('/workspace/dart/analysis_options/lib/default.yaml', r'''
+    newFile('/workspace/dart/analysis_options/lib/default.yaml', r'''
 linter:
   rules:
     - omit_local_variable_types
@@ -330,7 +330,7 @@
   test_collectSharedDataIdentifiers() async {
     var aPath = convertPath('/workspace/third_party/dart/aaa/lib/a.dart');
 
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {}
 ''');
 
@@ -342,7 +342,7 @@
 
   test_elements_export_dartCoreDynamic() async {
     var a_path = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 export 'dart:core' show dynamic;
 ''');
 
@@ -376,14 +376,14 @@
 
   test_findReferences_class() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {
   int foo;
 }
 ''');
 
     var bPath = convertPath('/workspace/dart/test/lib/b.dart');
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 
 void func() {
@@ -404,7 +404,7 @@
 
   test_findReferences_field() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {
   int foo = 0;
 
@@ -426,7 +426,7 @@
 
   test_findReferences_function() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 main() {
   foo('Hello');
 }
@@ -446,13 +446,13 @@
 
   test_findReferences_getter() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {
   int get foo => 6;
 }
 ''');
     var bPath = convertPath('/workspace/dart/test/lib/b.dart');
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 
 main() {
@@ -473,7 +473,7 @@
 
   test_findReferences_local_variable() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {
   void func(int n) {
     var foo = bar+1;
@@ -493,7 +493,7 @@
 
   test_findReferences_method() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {
   void func() {
    print('hello');
@@ -506,7 +506,7 @@
 ''');
 
     var bPath = convertPath('/workspace/dart/test/lib/b.dart');
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 
 main() {
@@ -528,13 +528,13 @@
 
   test_findReferences_setter() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {
   void set value(int m){ };
 }
 ''');
     var bPath = convertPath('/workspace/dart/test/lib/b.dart');
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 
 main() {
@@ -556,14 +556,14 @@
   test_findReferences_top_level_getter() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
 
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 int _foo;
 
 int get foo => _foo;
 ''');
 
     var bPath = convertPath('/workspace/dart/test/lib/b.dart');
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 
 main() {
@@ -584,14 +584,14 @@
   test_findReferences_top_level_setter() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
 
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 int _foo;
 
 void set foo(int bar) { _foo = bar; }
 ''');
 
     var bPath = convertPath('/workspace/dart/test/lib/b.dart');
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 
 main() {
@@ -612,7 +612,7 @@
   test_findReferences_top_level_variable() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
 
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 const int C = 42;
 
 void func() {
@@ -632,7 +632,7 @@
 
   test_findReferences_type_parameter() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class Foo<T> {
   List<T> l;
 
@@ -657,12 +657,12 @@
 
   test_findReferences_typedef() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 typedef func = int Function(int);
 
 ''');
     var bPath = convertPath('/workspace/dart/test/lib/b.dart');
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 
 void f(func o) {}
@@ -730,7 +730,7 @@
   }
 
   test_getErrors_reuse_changeDependency() async {
-    newFile2('/workspace/dart/test/lib/a.dart', r'''
+    newFile('/workspace/dart/test/lib/a.dart', r'''
 var a = 0;
 ''');
 
@@ -755,7 +755,7 @@
     // Change the dependency, new resolver.
     // The signature of the result is different.
     // The previously cached result cannot be used.
-    newFile2('/workspace/dart/test/lib/a.dart', r'''
+    newFile('/workspace/dart/test/lib/a.dart', r'''
 var a = 4.2;
 ''');
     createFileResolver();
@@ -795,7 +795,7 @@
   }
 
   test_getLibraryByUri() async {
-    newFile2('/workspace/dart/my/lib/a.dart', r'''
+    newFile('/workspace/dart/my/lib/a.dart', r'''
 class A {}
 ''');
 
@@ -813,7 +813,7 @@
   }
 
   test_getLibraryByUri_partOf() async {
-    newFile2('/workspace/dart/my/lib/a.dart', r'''
+    newFile('/workspace/dart/my/lib/a.dart', r'''
 part of 'b.dart';
 ''');
 
@@ -842,7 +842,7 @@
 
   test_hint_in_third_party() async {
     var aPath = convertPath('/workspace/third_party/dart/aaa/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 import 'dart:math';
 ''');
     await resolveFile(aPath);
@@ -868,7 +868,7 @@
   }
 
   test_nameOffset_class_method_fromBytes() async {
-    newFile2('/workspace/dart/test/lib/a.dart', r'''
+    newFile('/workspace/dart/test/lib/a.dart', r'''
 class A {
   void foo() {}
 }
@@ -899,7 +899,7 @@
   }
 
   test_nameOffset_unit_variable_fromBytes() async {
-    newFile2('/workspace/dart/test/lib/a.dart', r'''
+    newFile('/workspace/dart/test/lib/a.dart', r'''
 var a = 0;
 ''');
 
@@ -940,7 +940,7 @@
   }
 
   test_nullSafety_notEnabled() async {
-    newFile2('/workspace/dart/test/BUILD', '');
+    newFile('/workspace/dart/test/BUILD', '');
 
     await assertErrorsInCode(r'''
 void f(int? a) {}
@@ -966,15 +966,15 @@
     var bPath = convertPath('/workspace/dart/aaa/lib/b.dart');
     var cPath = convertPath('/workspace/dart/aaa/lib/c.dart');
 
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {}
 ''');
 
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 import 'a.dart';
 ''');
 
-    newFile2(cPath, r'''
+    newFile(cPath, r'''
 import 'a.dart';
 ''');
 
@@ -990,28 +990,28 @@
     var ePath = convertPath('/workspace/dart/aaa/lib/e.dart');
     var fPath = convertPath('/workspace/dart/aaa/lib/f.dart');
 
-    newFile2('/workspace/dart/aaa/lib/a.dart', r'''
+    newFile('/workspace/dart/aaa/lib/a.dart', r'''
 class A {}
 ''');
 
-    newFile2(bPath, r'''
+    newFile(bPath, r'''
 class B {}
 ''');
 
-    newFile2('/workspace/dart/aaa/lib/c.dart', r'''
+    newFile('/workspace/dart/aaa/lib/c.dart', r'''
 class C {}
 ''');
 
-    newFile2(dPath, r'''
+    newFile(dPath, r'''
 import 'a.dart';
 ''');
 
-    newFile2(ePath, r'''
+    newFile(ePath, r'''
 import 'a.dart';
 import 'b.dart';
 ''');
 
-    newFile2(fPath, r'''
+    newFile(fPath, r'''
 import 'c.dart';
  ''');
 
@@ -1026,7 +1026,7 @@
     var aPath = convertPath('/workspace/dart/aaa/lib/a.dart');
     var bPath = convertPath('/workspace/dart/aaa/lib/b.dart');
 
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {}
 ''');
 
@@ -1038,7 +1038,7 @@
 
   test_resolve_libraryWithPart_noLibraryDiscovery() async {
     var partPath = '/workspace/dart/test/lib/a.dart';
-    newFile2(partPath, r'''
+    newFile(partPath, r'''
 part of 'test.dart';
 
 class A {}
@@ -1056,7 +1056,7 @@
   }
 
   test_resolve_part_of_name() async {
-    newFile2('/workspace/dart/test/lib/a.dart', r'''
+    newFile('/workspace/dart/test/lib/a.dart', r'''
 library my.lib;
 
 part 'test.dart';
@@ -1079,7 +1079,7 @@
   }
 
   test_resolve_part_of_uri() async {
-    newFile2('/workspace/dart/test/lib/a.dart', r'''
+    newFile('/workspace/dart/test/lib/a.dart', r'''
 part 'test.dart';
 
 class A {
@@ -1101,7 +1101,7 @@
 
   test_resolveFile_cache() async {
     var path = convertPath('/workspace/dart/test/lib/test.dart');
-    newFile2(path, 'var a = 0;');
+    newFile(path, 'var a = 0;');
 
     // No resolved files yet.
     var testView = fileResolver.testView!;
@@ -1137,12 +1137,12 @@
 
   test_resolveFile_dontCache_whenForCompletion() async {
     var a_path = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(a_path, r'''
+    newFile(a_path, r'''
 part 'b.dart';
 ''');
 
     var b_path = convertPath('/workspace/dart/test/lib/b.dart');
-    newFile2(b_path, r'''
+    newFile(b_path, r'''
 part of 'a.dart';
 ''');
 
@@ -1166,7 +1166,7 @@
 
   test_resolveLibrary() async {
     var aPath = convertPath('/workspace/dart/test/lib/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 part 'test.dart';
 
 class A {
@@ -1174,7 +1174,7 @@
 }
 ''');
 
-    newFile2('/workspace/dart/test/lib/test.dart', r'''
+    newFile('/workspace/dart/test/lib/test.dart', r'''
 part of 'a.dart';
 
 void func() {
@@ -1190,8 +1190,8 @@
   }
 
   test_reuse_compatibleOptions() async {
-    newFile2('/workspace/dart/aaa/BUILD', '');
-    newFile2('/workspace/dart/bbb/BUILD', '');
+    newFile('/workspace/dart/aaa/BUILD', '');
+    newFile('/workspace/dart/bbb/BUILD', '');
 
     var aPath = '/workspace/dart/aaa/lib/a.dart';
     var aResult = await assertErrorsInFile(aPath, r'''
@@ -1214,14 +1214,14 @@
   }
 
   test_reuse_incompatibleOptions_implicitCasts() async {
-    newFile2('/workspace/dart/aaa/BUILD', '');
+    newFile('/workspace/dart/aaa/BUILD', '');
     newAnalysisOptionsYamlFile2('/workspace/dart/aaa', r'''
 analyzer:
   strong-mode:
     implicit-casts: false
 ''');
 
-    newFile2('/workspace/dart/bbb/BUILD', '');
+    newFile('/workspace/dart/bbb/BUILD', '');
     newAnalysisOptionsYamlFile2('/workspace/dart/bbb', r'''
 analyzer:
   strong-mode:
diff --git a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
index b230bf5..a5588e8 100644
--- a/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/assignment_test.dart
@@ -636,8 +636,8 @@
   }
 
   test_notLValue_typeLiteral_class_ambiguous_simple() async {
-    newFile2('$testPackageLibPath/a.dart', 'class C {}');
-    newFile2('$testPackageLibPath/b.dart', 'class C {}');
+    newFile('$testPackageLibPath/a.dart', 'class C {}');
+    newFile('$testPackageLibPath/b.dart', 'class C {}');
     await assertErrorsInCode('''
 import 'a.dart';
 import 'b.dart';
@@ -902,7 +902,7 @@
   }
 
   test_prefixedIdentifier_topLevel_compound() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int get x => 0;
 set x(num _) {}
 ''');
diff --git a/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart b/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart
index 2050ac9..6a8b233 100644
--- a/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/ast_rewrite_test.dart
@@ -543,7 +543,7 @@
   }
 
   test_targetPrefixedIdentifier_prefix_class_constructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   A.named(T a);
 }
@@ -597,7 +597,7 @@
   }
 
   test_targetPrefixedIdentifier_prefix_class_constructor_typeArguments() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   A.named(int a);
 }
@@ -665,7 +665,7 @@
   }
 
   test_targetPrefixedIdentifier_prefix_class_constructor_typeArguments_new() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   A.new(int a);
 }
@@ -733,7 +733,7 @@
   }
 
   test_targetPrefixedIdentifier_prefix_getter_method() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 A get foo => A();
 
 class A {
@@ -782,7 +782,7 @@
   }
 
   test_targetPrefixedIdentifier_typeAlias_interfaceType_constructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   A.named(T a);
 }
@@ -1021,7 +1021,7 @@
   }
 
   test_targetSimpleIdentifier_prefix_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T, U> {
   A(int a);
 }
@@ -1084,7 +1084,7 @@
   }
 
   test_targetSimpleIdentifier_prefix_extension() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 
 extension E<T> on A {
@@ -1113,7 +1113,7 @@
   }
 
   test_targetSimpleIdentifier_prefix_function() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void A<T, U>(int a) {}
 ''');
 
diff --git a/pkg/analyzer/test/src/dart/resolution/constant_test.dart b/pkg/analyzer/test/src/dart/resolution/constant_test.dart
index 24c790e..f243881 100644
--- a/pkg/analyzer/test/src/dart/resolution/constant_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/constant_test.dart
@@ -23,7 +23,7 @@
 @reflectiveTest
 class ConstantResolutionTest extends PubPackageResolutionTest {
   test_constructor_nullSafe_fromLegacy_super() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A(List<Object> a);
 }
@@ -46,7 +46,7 @@
   }
 
   test_constructor_nullSafe_fromLegacy_this() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A(List<Object> a) : this(a);
   const A.second(List<Object> a);
@@ -87,7 +87,7 @@
   }
 
   test_field_optIn_fromOptOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static const foo = 42;
 }
@@ -105,7 +105,7 @@
   }
 
   test_fromEnvironment_optOut_fromOptIn() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 
 const cBool = const bool.fromEnvironment('foo', defaultValue: false);
@@ -133,7 +133,7 @@
   }
 
   test_topLevelVariable_optIn_fromOptOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const foo = 42;
 ''');
 
@@ -150,11 +150,11 @@
   }
 
   test_topLevelVariable_optOut2() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const a = 42;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 import 'a.dart';
 
 const b = a;
@@ -173,7 +173,7 @@
   }
 
   test_topLevelVariable_optOut3() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 const a = int.fromEnvironment('a', defaultValue: 42);
 ''');
@@ -199,7 +199,7 @@
 class ConstantResolutionWithoutNullSafetyTest extends PubPackageResolutionTest
     with WithoutNullSafetyMixin {
   test_constantValue_defaultParameter_noDefaultValue() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A({int p});
 }
@@ -281,7 +281,7 @@
   }
 
   test_functionType_element_typeArguments() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef F<T> = T Function(int);
 const a = C<F<double>>();
 
@@ -312,7 +312,7 @@
   }
 
   test_imported_prefixedIdentifier_staticField_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const a = C.f;
 
 class C {
@@ -329,7 +329,7 @@
   }
 
   test_imported_prefixedIdentifier_staticField_extension() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const a = E.f;
 
 extension E on int {
@@ -346,7 +346,7 @@
   }
 
   test_imported_prefixedIdentifier_staticField_mixin() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const a = M.f;
 
 class C {}
@@ -365,7 +365,7 @@
   }
 
   test_imported_super_defaultFieldFormalParameter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'test.dart';
 
 class A {
@@ -409,7 +409,7 @@
 
   /// See https://github.com/dart-lang/sdk/issues/43462
   test_useLanguageVersionOfEnclosingLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class Wrapper {
   final int value;
   const Wrapper(Object value) : value = value as int;
diff --git a/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart b/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart
index aa3e3d3..61f308b 100644
--- a/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/constructor_reference_test.dart
@@ -830,7 +830,7 @@
   }
 
   test_prefixedAlias_generic_unnamed() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A<T> {
   A();
 }
@@ -886,7 +886,7 @@
   }
 
   test_prefixedClass_generic_named() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A<T> {
   A.foo();
 }
@@ -941,7 +941,7 @@
   }
 
   test_prefixedClass_generic_targetOfFunctionCall() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A<T> {
   A();
 }
@@ -999,7 +999,7 @@
   }
 
   test_prefixedClass_generic_unnamed() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A<T> {
   A();
 }
@@ -1388,7 +1388,7 @@
   }
 
   test_prefixedAlias_nonGeneric_named() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   A.foo();
 }
@@ -1430,7 +1430,7 @@
   }
 
   test_prefixedAlias_nonGeneric_unnamed() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   A();
 }
@@ -1472,7 +1472,7 @@
   }
 
   test_prefixedClass_nonGeneric_named() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   A.foo();
 }
@@ -1513,7 +1513,7 @@
   }
 
   test_prefixedClass_nonGeneric_unnamed() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   A();
 }
diff --git a/pkg/analyzer/test/src/dart/resolution/context_collection_resolution.dart b/pkg/analyzer/test/src/dart/resolution/context_collection_resolution.dart
index 27ff195..6aaca3b 100644
--- a/pkg/analyzer/test/src/dart/resolution/context_collection_resolution.dart
+++ b/pkg/analyzer/test/src/dart/resolution/context_collection_resolution.dart
@@ -104,8 +104,8 @@
   @override
   void setUp() {
     super.setUp();
-    newFile2('$workspaceRootPath/WORKSPACE', '');
-    newFile2('$myPackageRootPath/BUILD', '');
+    newFile('$workspaceRootPath/WORKSPACE', '');
+    newFile('$myPackageRootPath/BUILD', '');
   }
 
   @override
@@ -189,12 +189,12 @@
   }
 
   @override
-  File newFile2(String path, String content) {
+  File newFile(String path, String content) {
     if (_analysisContextCollection != null && !path.endsWith('.dart')) {
       throw StateError('Only dart files can be changed after analysis.');
     }
 
-    return super.newFile2(path, content);
+    return super.newFile(path, content);
   }
 
   @override
@@ -312,7 +312,7 @@
   }
 
   void writePackageConfig(String path, PackageConfigFileBuilder config) {
-    newFile2(
+    newFile(
       path,
       config.toContent(
         toUriStr: toUriStr,
diff --git a/pkg/analyzer/test/src/dart/resolution/export_test.dart b/pkg/analyzer/test/src/dart/resolution/export_test.dart
index 84d485d..50965c1 100644
--- a/pkg/analyzer/test/src/dart/resolution/export_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/export_test.dart
@@ -16,9 +16,9 @@
 @reflectiveTest
 class ExportResolutionTest extends PubPackageResolutionTest {
   test_configurations_default() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_html.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_io.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_html.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_io.dart', 'class A {}');
 
     declaredVariables = {
       'dart.library.html': 'false',
@@ -44,9 +44,9 @@
   }
 
   test_configurations_first() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_html.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_io.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_html.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_io.dart', 'class A {}');
 
     declaredVariables = {
       'dart.library.html': 'true',
@@ -72,9 +72,9 @@
   }
 
   test_configurations_second() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_html.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_io.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_html.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_io.dart', 'class A {}');
 
     declaredVariables = {
       'dart.library.html': 'false',
@@ -101,7 +101,7 @@
 
   /// Test that both getter and setter are in the export namespace.
   test_namespace_getter_setter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 get f => null;
 set f(_) {}
 ''');
diff --git a/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart b/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart
index bafe4c6..ed71412 100644
--- a/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/extension_method_test.dart
@@ -178,7 +178,7 @@
   }
 
   test_visibility_hidden() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 extension E on C {
   int a = 1;
@@ -196,7 +196,7 @@
   }
 
   test_visibility_notShown() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 extension E on C {
   int a = 1;
@@ -214,7 +214,7 @@
   }
 
   test_visibility_shadowed_byClass() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 extension E on C {
   int get a => 1;
@@ -235,12 +235,12 @@
   }
 
   test_visibility_shadowed_byImport() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 extension E on Object {
   int get a => 1;
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', '''
+    newFile('$testPackageLibPath/lib2.dart', '''
 class E {}
 class A {}
 ''');
@@ -259,7 +259,7 @@
   }
 
   test_visibility_shadowed_byLocal_imported() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 extension E on C {
   int get a => 1;
@@ -300,7 +300,7 @@
   }
 
   test_visibility_shadowed_byTopLevelVariable() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 extension E on C {
   int get a => 1;
@@ -321,7 +321,7 @@
   }
 
   test_visibility_shadowed_platformByNonPlatform() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 extension E on Object {
   int get a => 1;
 }
@@ -338,7 +338,7 @@
   }
 
   test_visibility_withPrefix() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 extension E on C {
   int get a => 1;
@@ -1551,7 +1551,7 @@
   }
 
   test_static_field_importedWithPrefix() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 
 extension E on C {
@@ -1589,7 +1589,7 @@
   }
 
   test_static_getter_importedWithPrefix() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 
 extension E on C {
@@ -1627,7 +1627,7 @@
   }
 
   test_static_method_importedWithPrefix() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 
 extension E on C {
@@ -1665,7 +1665,7 @@
   }
 
   test_static_setter_importedWithPrefix() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 
 extension E on C {
diff --git a/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart b/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart
index c8dc8ea..77648aa 100644
--- a/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/extension_override_test.dart
@@ -323,7 +323,7 @@
   }
 
   test_call_prefix_noTypeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E on A {
   int call(String s) => 0;
@@ -414,7 +414,7 @@
 
   test_call_prefix_typeArguments() async {
     // The test is failing because we're not yet doing type inference.
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E<T> on A {
   int call(T s) => 0;
@@ -779,7 +779,7 @@
   }
 
   test_getter_prefix_noTypeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E on A {
   int get g => 0;
@@ -863,7 +863,7 @@
   }
 
   test_getter_prefix_typeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E<T> on A {
   int get g => 0;
@@ -1149,7 +1149,7 @@
   }
 
   test_method_prefix_noTypeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E on A {
   void m() {}
@@ -1241,7 +1241,7 @@
   }
 
   test_method_prefix_typeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E<T> on A {
   void m() {}
@@ -1601,7 +1601,7 @@
   }
 
   test_operator_prefix_noTypeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E on A {
   void operator +(int offset) {}
@@ -1687,7 +1687,7 @@
   }
 
   test_operator_prefix_typeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E<T> on A {
   void operator +(int offset) {}
@@ -1999,7 +1999,7 @@
   }
 
   test_setter_prefix_noTypeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E on A {
   set s(int x) {}
@@ -2105,7 +2105,7 @@
   }
 
   test_setter_prefix_typeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E<T> on A {
   set s(int x) {}
@@ -2451,7 +2451,7 @@
   }
 
   test_setterAndGetter_prefix_noTypeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E on A {
   int get s => 0;
@@ -2560,7 +2560,7 @@
   }
 
   test_setterAndGetter_prefix_typeArguments() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class A {}
 extension E<T> on A {
   int get s => 0;
diff --git a/pkg/analyzer/test/src/dart/resolution/field_test.dart b/pkg/analyzer/test/src/dart/resolution/field_test.dart
index f4805b3..da2f7a6 100644
--- a/pkg/analyzer/test/src/dart/resolution/field_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/field_test.dart
@@ -63,7 +63,7 @@
   }
 
   test_type_inferred_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 var a = 0;
 ''');
diff --git a/pkg/analyzer/test/src/dart/resolution/for_element_test.dart b/pkg/analyzer/test/src/dart/resolution/for_element_test.dart
index 82803f7..3030ba7 100644
--- a/pkg/analyzer/test/src/dart/resolution/for_element_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/for_element_test.dart
@@ -17,7 +17,7 @@
 class ForEachElementTest extends PubPackageResolutionTest
     with WithoutNullSafetyMixin {
   test_optIn_fromOptOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A implements Iterable<int> {
   Iterator<int> iterator => throw 0;
 }
diff --git a/pkg/analyzer/test/src/dart/resolution/function_reference_test.dart b/pkg/analyzer/test/src/dart/resolution/function_reference_test.dart
index 98e0425..0e11f6c 100644
--- a/pkg/analyzer/test/src/dart/resolution/function_reference_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/function_reference_test.dart
@@ -1016,7 +1016,7 @@
   }
 
   test_extension_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 extension E<T> on String {}
 ''');
     await assertErrorsInCode('''
@@ -1802,7 +1802,7 @@
   }
 
   test_implicitCallTearoff_prefix_class_staticGetter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class C {
   static const v = C();
   const C();
@@ -1858,7 +1858,7 @@
   }
 
   test_implicitCallTearoff_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class C {
   T call<T>(T t) => t;
 }
@@ -2597,7 +2597,7 @@
   }
 
   test_instanceMethod_explicitReceiver_topLevelVariable_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   void foo<T>(T a) {}
 }
@@ -2652,7 +2652,7 @@
   }
 
   test_instanceMethod_explicitReceiver_topLevelVariable_prefix_unknown() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {}
 var a = A();
 ''');
@@ -3380,7 +3380,7 @@
   }
 
   test_staticMethod_explicitReceiver_importPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   static void foo<T>(T a) {}
 }
@@ -3435,7 +3435,7 @@
   }
 
   test_staticMethod_explicitReceiver_prefix_typeAlias() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   static void foo<T>(T a) {}
 }
@@ -3534,7 +3534,7 @@
   }
 
   test_staticMethod_explicitReciver_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   static void foo<T>(T a) {}
 }
@@ -3701,7 +3701,7 @@
   }
 
   test_topLevelFunction_importPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 void foo<T>(T arg) {}
 ''');
     await assertNoErrorsInCode('''
@@ -3745,7 +3745,7 @@
   }
 
   test_topLevelFunction_importPrefix_asTargetOfFunctionCall() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 void foo<T>(T arg) {}
 ''');
     await assertNoErrorsInCode('''
@@ -3896,7 +3896,7 @@
   }
 
   test_topLevelVariable_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 void Function<T>(T) foo = <T>(T arg) {}
 ''');
     await assertNoErrorsInCode('''
@@ -3940,7 +3940,7 @@
   }
 
   test_topLevelVariable_prefix_unknownIdentifier() async {
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
     await assertErrorsInCode('''
 import 'a.dart' as prefix;
 
@@ -4135,7 +4135,7 @@
   }
 
   test_unknownIdentifier_importPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
     await assertErrorsInCode('''
 import 'a.dart' as a;
 
diff --git a/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart b/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart
index 8d1af31..9fc8051 100644
--- a/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/generic_type_alias_test.dart
@@ -82,7 +82,7 @@
   }
 
   test_genericFunctionTypeCannotBeTypeArgument_optOutOfGenericMetadata() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 typedef G = Function<S>();
 ''');
     await assertErrorsInCode('''
@@ -131,7 +131,7 @@
   }
 
   test_missingGenericFunction_imported_withPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef F<T> = ;
 ''');
     await assertErrorsInCode(r'''
diff --git a/pkg/analyzer/test/src/dart/resolution/import_test.dart b/pkg/analyzer/test/src/dart/resolution/import_test.dart
index 0249c90..d52aea9 100644
--- a/pkg/analyzer/test/src/dart/resolution/import_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/import_test.dart
@@ -15,9 +15,9 @@
 @reflectiveTest
 class ImportDirectiveResolutionTest extends PubPackageResolutionTest {
   test_configurations_default() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_html.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_io.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_html.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_io.dart', 'class A {}');
 
     declaredVariables = {
       'dart.library.html': 'false',
@@ -43,9 +43,9 @@
   }
 
   test_configurations_first() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_html.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_io.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_html.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_io.dart', 'class A {}');
 
     declaredVariables = {
       'dart.library.html': 'true',
@@ -71,9 +71,9 @@
   }
 
   test_configurations_second() async {
-    newFile2('$testPackageLibPath/a.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_html.dart', 'class A {}');
-    newFile2('$testPackageLibPath/a_io.dart', 'class A {}');
+    newFile('$testPackageLibPath/a.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_html.dart', 'class A {}');
+    newFile('$testPackageLibPath/a_io.dart', 'class A {}');
 
     declaredVariables = {
       'dart.library.html': 'false',
diff --git a/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart b/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart
index 89bebe0..11c1fb7 100644
--- a/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/instance_creation_test.dart
@@ -407,7 +407,7 @@
   }
 
   test_error_wrongNumberOfTypeArgumentsConstructor_explicitNew_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class Foo<X> {
   Foo.bar();
 }
@@ -522,7 +522,7 @@
   }
 
   test_error_wrongNumberOfTypeArgumentsConstructor_implicitNew_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class Foo<X> {
   Foo.bar();
 }
diff --git a/pkg/analyzer/test/src/dart/resolution/instance_member_inference_class_test.dart b/pkg/analyzer/test/src/dart/resolution/instance_member_inference_class_test.dart
index 601714b..dcc7d64 100644
--- a/pkg/analyzer/test/src/dart/resolution/instance_member_inference_class_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/instance_member_inference_class_test.dart
@@ -159,7 +159,7 @@
   }
 
   test_field_multiple_gettersSetters_final_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 abstract class A {
   int get foo;
@@ -258,7 +258,7 @@
   }
 
   test_field_multiple_gettersSetters_notFinal_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 abstract class A {
   int get foo;
@@ -312,7 +312,7 @@
   }
 
   test_field_single_getter_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 abstract class A {
   int get foo;
@@ -330,7 +330,7 @@
   }
 
   test_field_single_setter_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 abstract class A {
   set foo(int _);
@@ -466,7 +466,7 @@
   }
 
   test_getter_single_getter_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 abstract class A {
   int get foo;
@@ -484,7 +484,7 @@
   }
 
   test_getter_single_setter_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 abstract class A {
   set foo(int _);
@@ -715,7 +715,7 @@
   }
 
   test_method_parameter_required_single_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 class A {
   void foo(int p) {}
@@ -895,7 +895,7 @@
   }
 
   test_method_return_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 abstract class A {
   int foo();
@@ -1057,7 +1057,7 @@
   }
 
   test_setter_single_getter_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 abstract class A {
   int get foo;
@@ -1075,7 +1075,7 @@
   }
 
   test_setter_single_setter_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 abstract class A {
   set foo(int _);
diff --git a/pkg/analyzer/test/src/dart/resolution/language_version_test.dart b/pkg/analyzer/test/src/dart/resolution/language_version_test.dart
index 7438e78..67fc64d 100644
--- a/pkg/analyzer/test/src/dart/resolution/language_version_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/language_version_test.dart
@@ -37,7 +37,7 @@
 }
 ''');
 
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 int a = 0;
 ''');
 
@@ -74,7 +74,7 @@
 }
 ''');
 
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 int a = 0;
 ''');
 
@@ -148,7 +148,7 @@
 
 class _FeaturesTest extends PubPackageResolutionTest {
   void _configureTestWithJsonConfig(String content) {
-    newFile2(
+    newFile(
       '$testPackageRootPath/.dart_tool/package_config.json',
       content,
     );
diff --git a/pkg/analyzer/test/src/dart/resolution/local_variable_test.dart b/pkg/analyzer/test/src/dart/resolution/local_variable_test.dart
index f83f9e7..2acac18 100644
--- a/pkg/analyzer/test/src/dart/resolution/local_variable_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/local_variable_test.dart
@@ -135,7 +135,7 @@
   }
 
   test_nonNullifyType() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 var a = 0;
 ''');
diff --git a/pkg/analyzer/test/src/dart/resolution/macro_test.dart b/pkg/analyzer/test/src/dart/resolution/macro_test.dart
index 5b42f0d..0178ec0 100644
--- a/pkg/analyzer/test/src/dart/resolution/macro_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/macro_test.dart
@@ -51,7 +51,7 @@
   }
 
   test_0() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'dart:async';
 import 'package:_fe_analyzer_shared/src/macros/api.dart';
 
diff --git a/pkg/analyzer/test/src/dart/resolution/metadata_test.dart b/pkg/analyzer/test/src/dart/resolution/metadata_test.dart
index cb2351c..25ad587 100644
--- a/pkg/analyzer/test/src/dart/resolution/metadata_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/metadata_test.dart
@@ -43,7 +43,7 @@
   }
 
   test_location_partDirective() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 part of 'test.dart';
 ''');
 
@@ -66,11 +66,11 @@
   }
 
   test_location_partOfDirective() async {
-    var libPath = newFile2('$testPackageLibPath/lib.dart', r'''
+    var libPath = newFile('$testPackageLibPath/lib.dart', r'''
 part 'part.dart';
 ''').path;
 
-    var partPath = newFile2('$testPackageLibPath/part.dart', r'''
+    var partPath = newFile('$testPackageLibPath/part.dart', r'''
 @foo
 part of 'lib.dart';
 const foo = 42;
@@ -212,7 +212,7 @@
   }
 
   test_optIn_fromOptOut_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A(int a);
 }
@@ -239,7 +239,7 @@
   }
 
   test_optIn_fromOptOut_class_constructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   final int a;
   const A.named(this.a);
@@ -273,7 +273,7 @@
   }
 
   test_optIn_fromOptOut_class_constructor_withDefault() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   final int a;
   const A.named({this.a = 42});
@@ -307,7 +307,7 @@
   }
 
   test_optIn_fromOptOut_class_getter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static const foo = 42;
 }
@@ -339,7 +339,7 @@
   }
 
   test_optIn_fromOptOut_getter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const foo = 42;
 ''');
 
@@ -364,7 +364,7 @@
   }
 
   test_optIn_fromOptOut_prefix_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A(int a);
 }
@@ -391,7 +391,7 @@
   }
 
   test_optIn_fromOptOut_prefix_class_constructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   const A.named(int a);
 }
@@ -418,7 +418,7 @@
   }
 
   test_optIn_fromOptOut_prefix_class_getter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static const foo = 0;
 }
@@ -445,7 +445,7 @@
   }
 
   test_optIn_fromOptOut_prefix_getter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const foo = 0;
 ''');
 
@@ -1338,7 +1338,7 @@
   }
 
   test_value_otherLibrary_implicitConst() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   final int f;
   const A(this.f);
@@ -1369,14 +1369,14 @@
   }
 
   test_value_otherLibrary_namedConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   final int f;
   const A.named(this.f);
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 import 'a.dart';
 
 @A.named(42)
@@ -1398,14 +1398,14 @@
   }
 
   test_value_otherLibrary_unnamedConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   final int f;
   const A(this.f);
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 import 'a.dart';
 
 @A(42)
@@ -1427,7 +1427,7 @@
   }
 
   test_value_prefix_typeAlias_class_staticConstField() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static const int foo = 42;
 }
@@ -1470,7 +1470,7 @@
   }
 
   test_value_prefix_typeAlias_generic_class_generic_all_inference_namedConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   final T f;
   const A.named(this.f);
@@ -1532,7 +1532,7 @@
   }
 
   test_value_prefix_typeAlias_generic_class_generic_all_inference_unnamedConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   final T f;
   const A(this.f);
@@ -1587,7 +1587,7 @@
   }
 
   test_value_prefix_typeAlias_generic_class_generic_all_typeArguments_namedConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   final T f;
   const A.named(this.f);
@@ -1659,7 +1659,7 @@
   }
 
   test_value_prefix_typeAlias_generic_class_generic_all_typeArguments_unnamedConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   final T f;
   const A(this.f);
diff --git a/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart b/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart
index 3801936..8e44628 100644
--- a/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart
@@ -20,7 +20,7 @@
 class MethodInvocationResolutionTest extends PubPackageResolutionTest
     with MethodInvocationResolutionTestCases {
   test_hasReceiver_deferredImportPrefix_loadLibrary_optIn_fromOptOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
 
@@ -3238,10 +3238,10 @@
   }
 
   test_error_ambiguousImport_topFunction() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void foo(int _) {}
 ''');
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 void foo(int _) {}
 ''');
 
@@ -3295,10 +3295,10 @@
   }
 
   test_error_ambiguousImport_topFunction_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void foo(int _) {}
 ''');
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 void foo(int _) {}
 ''');
 
@@ -3967,7 +3967,7 @@
   }
 
   test_error_prefixIdentifierNotFollowedByDot() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void foo() {}
 ''');
 
@@ -4810,7 +4810,7 @@
   }
 
   test_error_undefinedMethod_private() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo(int _) {}
 }
@@ -6024,7 +6024,7 @@
   }
 
   test_hasReceiver_importPrefix_topFunction() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 T foo<T extends num>(T a, T b) => a;
 ''');
 
@@ -6095,7 +6095,7 @@
   }
 
   test_hasReceiver_importPrefix_topGetter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 T Function<T>(T a, T b) get foo => null;
 ''');
 
@@ -6726,7 +6726,7 @@
   }
 
   test_hasReceiver_prefixed_class_staticGetter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class C {
   static double Function(int) get foo => null;
 }
@@ -6811,7 +6811,7 @@
   }
 
   test_hasReceiver_prefixed_class_staticMethod() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class C {
   static void foo(int _) => null;
 }
diff --git a/pkg/analyzer/test/src/dart/resolution/namespace_test.dart b/pkg/analyzer/test/src/dart/resolution/namespace_test.dart
index 9a82a1d..9bb1db1 100644
--- a/pkg/analyzer/test/src/dart/resolution/namespace_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/namespace_test.dart
@@ -15,7 +15,7 @@
 @reflectiveTest
 class ImportResolutionTest extends PubPackageResolutionTest {
   test_overrideCoreType_Never() async {
-    newFile2('$testPackageLibPath/declares_never.dart', '''
+    newFile('$testPackageLibPath/declares_never.dart', '''
 class Never {}
 ''');
     await assertNoErrorsInCode(r'''
diff --git a/pkg/analyzer/test/src/dart/resolution/non_nullable_bazel_workspace_test.dart b/pkg/analyzer/test/src/dart/resolution/non_nullable_bazel_workspace_test.dart
index a91b101..ce660c5 100644
--- a/pkg/analyzer/test/src/dart/resolution/non_nullable_bazel_workspace_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/non_nullable_bazel_workspace_test.dart
@@ -21,7 +21,7 @@
   bool get isNullSafetyEnabled => true;
 
   test_buildFile_legacy_commentedOut() async {
-    newFile2('$myPackageRootPath/BUILD', r'''
+    newFile('$myPackageRootPath/BUILD', r'''
 dart_package(
 #  null_safety = True,
 ''');
@@ -35,7 +35,7 @@
   }
 
   test_buildFile_nonNullable() async {
-    newFile2('$myPackageRootPath/BUILD', r'''
+    newFile('$myPackageRootPath/BUILD', r'''
 dart_package(
   null_safety = True,
 )
@@ -67,7 +67,7 @@
   }
 
   test_buildFile_nonNullable_languageVersion_current() async {
-    newFile2('$myPackageRootPath/BUILD', r'''
+    newFile('$myPackageRootPath/BUILD', r'''
 dart_package(
   null_safety = True,
 )
@@ -84,7 +84,7 @@
   }
 
   test_buildFile_nonNullable_languageVersion_fromWorkspace() async {
-    newFile2('$workspaceRootPath/dart/build_defs/bzl/language.bzl', r'''
+    newFile('$workspaceRootPath/dart/build_defs/bzl/language.bzl', r'''
 _version = "2.9"
 _version_null_safety = "2.14"
 _version_for_analyzer = _version_null_safety
@@ -96,7 +96,7 @@
 )
 ''');
 
-    newFile2('$myPackageRootPath/BUILD', r'''
+    newFile('$myPackageRootPath/BUILD', r'''
 dart_package(
   null_safety = True,
 )
@@ -113,7 +113,7 @@
   }
 
   test_buildFile_nonNullable_oneLine_noComma() async {
-    newFile2('$myPackageRootPath/BUILD', r'''
+    newFile('$myPackageRootPath/BUILD', r'''
 dart_package(null_safety = True)
 ''');
 
@@ -126,7 +126,7 @@
   }
 
   test_buildFile_nonNullable_soundNullSafety() async {
-    newFile2('$myPackageRootPath/BUILD', r'''
+    newFile('$myPackageRootPath/BUILD', r'''
 dart_package(
   sound_null_safety = True
 )
@@ -141,7 +141,7 @@
   }
 
   test_buildFile_nonNullable_withComments() async {
-    newFile2('$myPackageRootPath/BUILD', r'''
+    newFile('$myPackageRootPath/BUILD', r'''
 dart_package(
   # Preceding comment.
   null_safety = True,  # Trailing comment.
diff --git a/pkg/analyzer/test/src/dart/resolution/non_nullable_test.dart b/pkg/analyzer/test/src/dart/resolution/non_nullable_test.dart
index 3f34708..7eb4066 100644
--- a/pkg/analyzer/test/src/dart/resolution/non_nullable_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/non_nullable_test.dart
@@ -59,7 +59,7 @@
   }
 
   test_library_typeProvider_typeSystem() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
     await resolveTestCode(r'''
diff --git a/pkg/analyzer/test/src/dart/resolution/optional_const_test.dart b/pkg/analyzer/test/src/dart/resolution/optional_const_test.dart
index 8f6dc88..6306b35 100644
--- a/pkg/analyzer/test/src/dart/resolution/optional_const_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/optional_const_test.dart
@@ -234,7 +234,7 @@
   }
 
   test_prefixed_unnamed_generic() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class C<T> {
   const C();
 }
@@ -286,7 +286,7 @@
 
   Future<InstanceCreationExpression> _resolveImplicitConst(String expr,
       {String? prefix}) async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   const A();
   const A.named();
@@ -298,12 +298,12 @@
 ''');
 
     if (prefix != null) {
-      newFile2('$testPackageLibPath/b.dart', '''
+      newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart' as $prefix;
 const a = $expr;
 ''');
     } else {
-      newFile2('$testPackageLibPath/b.dart', '''
+      newFile('$testPackageLibPath/b.dart', '''
 import 'a.dart';
 const a = $expr;
 ''');
diff --git a/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart
index 1847d44..e1e22db 100644
--- a/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/postfix_expression_test.dart
@@ -780,7 +780,7 @@
   }
 
   test_inc_prefixedIdentifier_topLevel() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int x = 0;
 ''');
     await assertNoErrorsInCode(r'''
diff --git a/pkg/analyzer/test/src/dart/resolution/prefix_element_test.dart b/pkg/analyzer/test/src/dart/resolution/prefix_element_test.dart
index 845f018..921331a 100644
--- a/pkg/analyzer/test/src/dart/resolution/prefix_element_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/prefix_element_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class PrefixElementTest extends PubPackageResolutionTest {
   test_scope_lookup() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var foo = 0;
 ''');
 
@@ -40,11 +40,11 @@
   }
 
   test_scope_lookup_ambiguous_notSdk_both() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var foo = 0;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 var foo = 1.2;
 ''');
 
@@ -79,7 +79,7 @@
   }
 
   test_scope_lookup_ambiguous_notSdk_first() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var pi = 4;
 ''');
 
@@ -101,7 +101,7 @@
   }
 
   test_scope_lookup_ambiguous_notSdk_second() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var pi = 4;
 ''');
 
@@ -123,11 +123,11 @@
   }
 
   test_scope_lookup_ambiguous_same() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var foo = 0;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 export 'a.dart';
 ''');
 
@@ -154,11 +154,11 @@
   }
 
   test_scope_lookup_differentPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var foo = 0;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 var bar = 0;
 ''');
 
diff --git a/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart
index 888d74f..4421bb0 100644
--- a/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/prefix_expression_test.dart
@@ -700,7 +700,7 @@
   }
 
   test_plusPlus_prefixedIdentifier_topLevel() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int x = 0;
 ''');
     await assertNoErrorsInCode(r'''
diff --git a/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart b/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart
index 1a011b1..6c71f9f 100644
--- a/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/prefixed_identifier_test.dart
@@ -19,7 +19,7 @@
 class PrefixedIdentifierResolutionTest extends PubPackageResolutionTest
     with PrefixedIdentifierResolutionTestCases {
   test_deferredImportPrefix_loadLibrary_optIn_fromOptOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
 
@@ -145,7 +145,7 @@
   }
 
   test_implicitCall_tearOff_nullable() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int call() => 0;
 }
@@ -171,7 +171,7 @@
   }
 
   test_read_typedef_interfaceType() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef A = List<int>;
 ''');
 
@@ -298,7 +298,7 @@
   }
 
   test_class_read_typedef_functionType() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef A = void Function();
 ''');
 
@@ -431,7 +431,7 @@
   }
 
   test_implicitCall_tearOff() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int call() => 0;
 }
diff --git a/pkg/analyzer/test/src/dart/resolution/resolution.dart b/pkg/analyzer/test/src/dart/resolution/resolution.dart
index ae050fb..7f40418 100644
--- a/pkg/analyzer/test/src/dart/resolution/resolution.dart
+++ b/pkg/analyzer/test/src/dart/resolution/resolution.dart
@@ -87,7 +87,7 @@
   VoidType get voidType => VoidTypeImpl.instance;
 
   void addTestFile(String content) {
-    newFile2(testFilePath, content);
+    newFile(testFilePath, content);
   }
 
   void assertAssignment(
@@ -281,7 +281,7 @@
     List<ExpectedError> expectedErrors,
   ) async {
     path = convertPath(path);
-    newFile2(path, content);
+    newFile(path, content);
 
     var result = await resolveFile(path);
     assertErrorsInResolvedUnit(result, expectedErrors);
@@ -826,7 +826,7 @@
 
   /// Create a new file with the [path] and [content], resolve it into [result].
   Future<void> resolveFileCode(String path, String content) {
-    newFile2(path, content);
+    newFile(path, content);
     return resolveFile2(path);
   }
 
diff --git a/pkg/analyzer/test/src/dart/resolution/top_level_variable_test.dart b/pkg/analyzer/test/src/dart/resolution/top_level_variable_test.dart
index f478f61..1c97297 100644
--- a/pkg/analyzer/test/src/dart/resolution/top_level_variable_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/top_level_variable_test.dart
@@ -19,7 +19,7 @@
 class TopLevelVariableTest extends PubPackageResolutionTest
     with TopLevelVariableTestCases {
   test_type_inferred_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 var a = 0;
 ''');
diff --git a/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart b/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart
index c761dab..c8072cf 100644
--- a/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/type_inference/function_expression_test.dart
@@ -18,7 +18,7 @@
 class FunctionExpressionTest extends PubPackageResolutionTest
     with FunctionExpressionTestCases {
   test_contextFunctionType_nonNullify() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 
 int Function(int a) v;
@@ -42,7 +42,7 @@
   }
 
   test_contextFunctionType_nonNullify_returnType_takeActual() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 
 void foo(int Function() x) {}
@@ -60,7 +60,7 @@
   }
 
   test_contextFunctionType_nonNullify_returnType_takeContext() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 
 void foo(int Function() x) {}
@@ -117,7 +117,7 @@
   }
 
   test_optOut_downward_returnType_expressionBody_Null() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void foo(Map<String, String> Function() f) {}
 ''');
     await resolveTestCode('''
@@ -460,7 +460,7 @@
   }
 
   test_noContext_returnType_sync_blockBody_notNullable_switch_onEnum_imported() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 enum E { a, b }
 ''');
 
diff --git a/pkg/analyzer/test/src/dart/resolution/type_literal_test.dart b/pkg/analyzer/test/src/dart/resolution/type_literal_test.dart
index a0a53a1..5f4fe3c 100644
--- a/pkg/analyzer/test/src/dart/resolution/type_literal_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/type_literal_test.dart
@@ -28,7 +28,7 @@
   }
 
   test_class_importPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class C<T> {}
 ''');
     await assertNoErrorsInCode('''
@@ -119,7 +119,7 @@
   }
 
   test_classAlias_importPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class C<T> {}
 typedef CA<T> = C<T>;
 ''');
@@ -163,7 +163,7 @@
   }
 
   test_functionAlias_importPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 typedef Fn<T> = void Function(T);
 ''');
     await assertNoErrorsInCode('''
@@ -204,7 +204,7 @@
   }
 
   test_functionAlias_targetOfMethodCall_importPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 typedef Fn<T> = void Function(T);
 ''');
     await assertErrorsInCode('''
@@ -433,7 +433,7 @@
   }
 
   test_class_importPrefix() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class C<T> {}
 ''');
     await assertErrorsInCode('''
diff --git a/pkg/analyzer/test/src/dart/resolution/type_name_test.dart b/pkg/analyzer/test/src/dart/resolution/type_name_test.dart
index 1e9d9ca..33d81f0 100644
--- a/pkg/analyzer/test/src/dart/resolution/type_name_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/type_name_test.dart
@@ -24,7 +24,7 @@
   }
 
   test_optIn_fromOptOut_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
 
@@ -43,7 +43,7 @@
   }
 
   test_optIn_fromOptOut_class_generic_toBounds() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T extends num> {}
 ''');
 
@@ -62,7 +62,7 @@
   }
 
   test_optIn_fromOptOut_class_generic_toBounds_dynamic() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {}
 ''');
 
@@ -81,7 +81,7 @@
   }
 
   test_optIn_fromOptOut_class_generic_typeArguments() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {}
 ''');
 
@@ -100,7 +100,7 @@
   }
 
   test_optIn_fromOptOut_functionTypeAlias() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef F = int Function(bool);
 ''');
 
@@ -124,7 +124,7 @@
   }
 
   test_optIn_fromOptOut_functionTypeAlias_generic_dynamic() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef F<T> = T Function(bool);
 ''');
 
@@ -148,7 +148,7 @@
   }
 
   test_optIn_fromOptOut_functionTypeAlias_generic_toBounds() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef F<T extends num> = T Function(bool);
 ''');
 
@@ -172,7 +172,7 @@
   }
 
   test_optIn_fromOptOut_functionTypeAlias_generic_typeArguments() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef F<T> = T Function(bool);
 ''');
 
@@ -196,7 +196,7 @@
   }
 
   test_optOut_fromOptIn_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 class A {}
 ''');
@@ -217,7 +217,7 @@
   }
 
   test_optOut_fromOptIn_class_generic_toBounds() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 class A<T extends num> {}
 ''');
@@ -238,7 +238,7 @@
   }
 
   test_optOut_fromOptIn_class_generic_toBounds_dynamic() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 class A<T> {}
 ''');
@@ -259,7 +259,7 @@
   }
 
   test_optOut_fromOptIn_class_generic_typeArguments() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 class A<T> {}
 ''');
@@ -280,7 +280,7 @@
   }
 
   test_optOut_fromOptIn_functionTypeAlias() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 typedef F = int Function();
 ''');
@@ -301,7 +301,7 @@
   }
 
   test_optOut_fromOptIn_functionTypeAlias_generic_toBounds() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 typedef F<T extends num> = T Function();
 ''');
@@ -322,7 +322,7 @@
   }
 
   test_optOut_fromOptIn_functionTypeAlias_generic_toBounds_dynamic() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 typedef F<T> = T Function();
 ''');
@@ -343,7 +343,7 @@
   }
 
   test_optOut_fromOptIn_functionTypeAlias_generic_typeArguments() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 typedef F<T> = T Function();
 ''');
@@ -437,7 +437,7 @@
   }
 
   test_typeAlias_asParameterType_interfaceType_none_inLegacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef X<T> = Map<int, T>;
 ''');
     await assertNoErrorsInCode(r'''
@@ -473,7 +473,7 @@
   }
 
   test_typeAlias_asParameterType_interfaceType_question_inLegacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef X<T> = List<T?>;
 ''');
     await assertNoErrorsInCode(r'''
@@ -509,7 +509,7 @@
   }
 
   test_typeAlias_asParameterType_Never_none_inLegacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 typedef X = Never;
 ''');
     await assertNoErrorsInCode(r'''
diff --git a/pkg/analyzer/test/src/dart/resolution/yield_statement_test.dart b/pkg/analyzer/test/src/dart/resolution/yield_statement_test.dart
index 972c387..c51f5dc 100644
--- a/pkg/analyzer/test/src/dart/resolution/yield_statement_test.dart
+++ b/pkg/analyzer/test/src/dart/resolution/yield_statement_test.dart
@@ -18,7 +18,7 @@
   setUp() {
     super.setUp();
 
-    newFile2('$testPackageLibPath/my_stream.dart', r'''
+    newFile('$testPackageLibPath/my_stream.dart', r'''
 import 'dart:async';
 
 export 'dart:async';
diff --git a/pkg/analyzer/test/src/dart/resolver/exit_detector_test.dart b/pkg/analyzer/test/src/dart/resolver/exit_detector_test.dart
index f80c2d8..ed07cc2 100644
--- a/pkg/analyzer/test/src/dart/resolver/exit_detector_test.dart
+++ b/pkg/analyzer/test/src/dart/resolver/exit_detector_test.dart
@@ -114,7 +114,7 @@
   void _assertHasReturn(String expressionCode, bool expected) {
     var path = convertPath('/test/lib/test.dart');
 
-    newFile2(path, '''
+    newFile(path, '''
 void f() { // ref
   $expressionCode;
 }
@@ -903,7 +903,7 @@
   void _assertHasReturn(String statementCode, bool expected) {
     var path = convertPath('/test/lib/test.dart');
 
-    newFile2(path, '''
+    newFile(path, '''
 void f() { // ref
   $statementCode
 }
diff --git a/pkg/analyzer/test/src/dart/sdk/sdk_test.dart b/pkg/analyzer/test/src/dart/sdk/sdk_test.dart
index af30a09..346e74a 100644
--- a/pkg/analyzer/test/src/dart/sdk/sdk_test.dart
+++ b/pkg/analyzer/test/src/dart/sdk/sdk_test.dart
@@ -233,7 +233,7 @@
       parent = parent.getChildAssumingFolder(segments[i]);
     }
     File file = parent.getChildAssumingFile(segments[last]);
-    newFile2(file.path, content);
+    newFile(file.path, content);
   }
 
   String _librariesFileContent() => '''
diff --git a/pkg/analyzer/test/src/diagnostics/ambiguous_export_test.dart b/pkg/analyzer/test/src/diagnostics/ambiguous_export_test.dart
index ee5cdfb..0c38a2d 100644
--- a/pkg/analyzer/test/src/diagnostics/ambiguous_export_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/ambiguous_export_test.dart
@@ -16,10 +16,10 @@
 @reflectiveTest
 class AmbiguousExportTest extends PubPackageResolutionTest {
   test_class() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class N {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 class N {}
 ''');
     await assertErrorsInCode(r'''
@@ -31,10 +31,10 @@
   }
 
   test_extensions_bothExported() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 extension E on String {}
 ''');
     await assertErrorsInCode(r'''
@@ -46,7 +46,7 @@
   }
 
   test_extensions_localAndExported() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {}
 ''');
     await assertNoErrorsInCode(r'''
diff --git a/pkg/analyzer/test/src/diagnostics/ambiguous_import_test.dart b/pkg/analyzer/test/src/diagnostics/ambiguous_import_test.dart
index ec177b1..d295d46 100644
--- a/pkg/analyzer/test/src/diagnostics/ambiguous_import_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/ambiguous_import_test.dart
@@ -20,11 +20,11 @@
 @reflectiveTest
 class AmbiguousImportTest extends PubPackageResolutionTest {
   test_annotation_getter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const foo = 0;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 const foo = 0;
 ''');
 
@@ -41,10 +41,10 @@
   }
 
   test_as() async {
-    newFile2("$testPackageLibPath/lib1.dart", '''
+    newFile("$testPackageLibPath/lib1.dart", '''
 library lib1;
 class N {}''');
-    newFile2("$testPackageLibPath/lib2.dart", '''
+    newFile("$testPackageLibPath/lib2.dart", '''
 library lib2;
 class N {}''');
     await assertErrorsInCode('''
@@ -56,10 +56,10 @@
   }
 
   test_extends() async {
-    newFile2("$testPackageLibPath/lib1.dart", '''
+    newFile("$testPackageLibPath/lib1.dart", '''
 library lib1;
 class N {}''');
-    newFile2("$testPackageLibPath/lib2.dart", '''
+    newFile("$testPackageLibPath/lib2.dart", '''
 library lib2;
 class N {}''');
     await assertErrorsInCode('''
@@ -72,10 +72,10 @@
   }
 
   test_implements() async {
-    newFile2("$testPackageLibPath/lib1.dart", '''
+    newFile("$testPackageLibPath/lib1.dart", '''
 library lib1;
 class N {}''');
-    newFile2("$testPackageLibPath/lib2.dart", '''
+    newFile("$testPackageLibPath/lib2.dart", '''
 library lib2;
 class N {}''');
     await assertErrorsInCode('''
@@ -88,19 +88,19 @@
   }
 
   test_inPart() async {
-    newFile2("$testPackageLibPath/lib1.dart", '''
+    newFile("$testPackageLibPath/lib1.dart", '''
 library lib1;
 class N {}
 ''');
-    newFile2("$testPackageLibPath/lib2.dart", '''
+    newFile("$testPackageLibPath/lib2.dart", '''
 library lib2;
 class N {}
 ''');
-    newFile2('$testPackageLibPath/part.dart', '''
+    newFile('$testPackageLibPath/part.dart', '''
 part of lib;
 class A extends N {}
 ''');
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 import 'lib1.dart';
 import 'lib2.dart';
@@ -120,10 +120,10 @@
   }
 
   test_instanceCreation() async {
-    newFile2("$testPackageLibPath/lib1.dart", '''
+    newFile("$testPackageLibPath/lib1.dart", '''
 library lib1;
 class N {}''');
-    newFile2("$testPackageLibPath/lib2.dart", '''
+    newFile("$testPackageLibPath/lib2.dart", '''
 library lib2;
 class N {}''');
     await assertErrorsInCode('''
@@ -136,10 +136,10 @@
   }
 
   test_is() async {
-    newFile2("$testPackageLibPath/lib1.dart", '''
+    newFile("$testPackageLibPath/lib1.dart", '''
 library lib1;
 class N {}''');
-    newFile2("$testPackageLibPath/lib2.dart", '''
+    newFile("$testPackageLibPath/lib2.dart", '''
 library lib2;
 class N {}''');
     await assertErrorsInCode('''
@@ -151,10 +151,10 @@
   }
 
   test_qualifier() async {
-    newFile2("$testPackageLibPath/lib1.dart", '''
+    newFile("$testPackageLibPath/lib1.dart", '''
 library lib1;
 class N {}''');
-    newFile2("$testPackageLibPath/lib2.dart", '''
+    newFile("$testPackageLibPath/lib2.dart", '''
 library lib2;
 class N {}''');
     await assertErrorsInCode('''
@@ -168,7 +168,7 @@
   test_systemLibrary_nonSystemLibrary() async {
     // From the spec, "a declaration from a non-system library shadows
     // declarations from system libraries."
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class StreamController {}
 ''');
     await assertNoErrorsInCode('''
@@ -190,10 +190,10 @@
   }
 
   test_typeAnnotation() async {
-    newFile2("$testPackageLibPath/lib1.dart", '''
+    newFile("$testPackageLibPath/lib1.dart", '''
 library lib1;
 class N {}''');
-    newFile2("$testPackageLibPath/lib2.dart", '''
+    newFile("$testPackageLibPath/lib2.dart", '''
 library lib2;
 class N {}''');
     await assertErrorsInCode('''
@@ -220,10 +220,10 @@
   }
 
   test_typeArgument_annotation() async {
-    newFile2("$testPackageLibPath/lib1.dart", '''
+    newFile("$testPackageLibPath/lib1.dart", '''
 library lib1;
 class N {}''');
-    newFile2("$testPackageLibPath/lib2.dart", '''
+    newFile("$testPackageLibPath/lib2.dart", '''
 library lib2;
 class N {}''');
     await assertErrorsInCode('''
@@ -236,10 +236,10 @@
   }
 
   test_typeArgument_instanceCreation() async {
-    newFile2("$testPackageLibPath/lib1.dart", '''
+    newFile("$testPackageLibPath/lib1.dart", '''
 library lib1;
 class N {}''');
-    newFile2("$testPackageLibPath/lib2.dart", '''
+    newFile("$testPackageLibPath/lib2.dart", '''
 library lib2;
 class N {}''');
     await assertErrorsInCode('''
@@ -252,11 +252,11 @@
   }
 
   test_variable_read() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 var x;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 var x;
 ''');
 
@@ -273,11 +273,11 @@
   }
 
   test_variable_read_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 var x;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 var x;
 ''');
 
@@ -294,11 +294,11 @@
   }
 
   test_variable_write() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 var x;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 var x;
 ''');
 
@@ -321,11 +321,11 @@
   }
 
   test_variable_write_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 var x;
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 var x;
 ''');
 
diff --git a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart
index 4a5a07d..d573d35 100644
--- a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart
@@ -210,7 +210,7 @@
 mixin ArgumentTypeNotAssignableTestCases on PubPackageResolutionTest {
   test_ambiguousClassName() async {
     // See dartbug.com/19624
-    newFile2('$testPackageLibPath/lib2.dart', '''
+    newFile('$testPackageLibPath/lib2.dart', '''
 class _A {}
 g(h(_A a)) {}''');
     await assertErrorsInCode('''
diff --git a/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart b/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart
index d644c46..9f1868c 100644
--- a/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/assignment_of_do_not_store_test.dart
@@ -296,7 +296,7 @@
   }
 
   test_topLevelVariable_libraryAnnotation() async {
-    newFile2('$testPackageLibPath/library.dart', '''
+    newFile('$testPackageLibPath/library.dart', '''
 @doNotStore
 library lib;
 
diff --git a/pkg/analyzer/test/src/diagnostics/conflicting_generic_interfaces_test.dart b/pkg/analyzer/test/src/diagnostics/conflicting_generic_interfaces_test.dart
index 34462f3..9bf45bb 100644
--- a/pkg/analyzer/test/src/diagnostics/conflicting_generic_interfaces_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/conflicting_generic_interfaces_test.dart
@@ -47,7 +47,7 @@
   }
 
   test_class_extends_implements_optOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class I<T> {}
 class A implements I<int> {}
 class B implements I<int?> {}
@@ -61,7 +61,7 @@
   }
 
   test_class_extends_optIn_implements_optOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {}
 
 class B extends A<int> {}
@@ -86,7 +86,7 @@
   }
 
   test_class_mixed_viaLegacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {}
 
 class Bi implements A<int> {}
@@ -95,7 +95,7 @@
 ''');
 
     // Both `Bi` and `Biq` implement `A<int*>` in legacy, so identical.
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 // @dart = 2.7
 import 'a.dart';
 
@@ -124,11 +124,11 @@
   }
 
   test_class_topMerge_optIn_optOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 // @dart = 2.5
 import 'a.dart';
 
diff --git a/pkg/analyzer/test/src/diagnostics/const_constructor_field_type_mismatch_test.dart b/pkg/analyzer/test/src/diagnostics/const_constructor_field_type_mismatch_test.dart
index 8988cf5..0526a6f 100644
--- a/pkg/analyzer/test/src/diagnostics/const_constructor_field_type_mismatch_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/const_constructor_field_type_mismatch_test.dart
@@ -75,7 +75,7 @@
   }
 
   test_notGeneric_null_forNonNullable_fromLegacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class C {
   final int f;
   const C(a) : f = a;
diff --git a/pkg/analyzer/test/src/diagnostics/const_constructor_param_type_mismatch_test.dart b/pkg/analyzer/test/src/diagnostics/const_constructor_param_type_mismatch_test.dart
index 29e89a5..060ade5 100644
--- a/pkg/analyzer/test/src/diagnostics/const_constructor_param_type_mismatch_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/const_constructor_param_type_mismatch_test.dart
@@ -131,7 +131,7 @@
   }
 
   test_int_to_double_reference_from_other_library_other_file_after() async {
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 import 'test.dart';
 class D {
   final C c;
@@ -159,7 +159,7 @@
 }
 const C constant = const C(0);
 ''');
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 import 'test.dart';
 class D {
   final C c;
@@ -183,7 +183,7 @@
   }
 
   test_int_to_double_via_default_value_other_file_after() async {
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 class C {
   final double x;
   const C([this.x = 0]);
@@ -199,7 +199,7 @@
   }
 
   test_int_to_double_via_default_value_other_file_before() async {
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 class C {
   final double x;
   const C([this.x = 0]);
diff --git a/pkg/analyzer/test/src/diagnostics/const_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/const_deferred_class_test.dart
index f39c1e2..eb3a6c0 100644
--- a/pkg/analyzer/test/src/diagnostics/const_deferred_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/const_deferred_class_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class ConstDeferredClassTest extends PubPackageResolutionTest {
   test_namedConstructor() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {
   const A.b();
@@ -32,7 +32,7 @@
   }
 
   test_nonFunctionTypedef() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {
   const A();
@@ -51,7 +51,7 @@
   }
 
   test_unnamed() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {
   const A();
diff --git a/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart b/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart
index e51f7d3..55980e8 100644
--- a/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/const_eval_throws_exception_test.dart
@@ -82,7 +82,7 @@
 
   test_CastError_intToDouble_constructor_importAnalyzedAfter() async {
     // See dartbug.com/35993
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 class Foo {
   final double value;
 
@@ -112,7 +112,7 @@
 
   test_CastError_intToDouble_constructor_importAnalyzedBefore() async {
     // See dartbug.com/35993
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 class Foo {
   final double value;
 
@@ -141,7 +141,7 @@
   }
 
   test_default_constructor_arg_empty_map_import() async {
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 class C {
   final Map<String, int> m;
   const C({this.m = const <String, int>{}})
@@ -290,7 +290,7 @@
   }
 
   test_invalid_constructorFieldInitializer_fromSeparateLibrary() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 class A<T> {
   final int f;
   const A() : f = T.foo;
diff --git a/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_from_deferred_library_test.dart
index ba5f389..3f7b454 100644
--- a/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_from_deferred_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/const_initialized_with_non_constant_value_from_deferred_library_test.dart
@@ -18,7 +18,7 @@
 class ConstInitializedWithNonConstantValueFromDeferredLibraryTest
     extends PubPackageResolutionTest {
   test_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 const V = 1;
 ''');
@@ -36,7 +36,7 @@
   }
 
   test_nested() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 const V = 1;
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/const_with_non_type_test.dart b/pkg/analyzer/test/src/diagnostics/const_with_non_type_test.dart
index 0c5ecbe..79d04f3 100644
--- a/pkg/analyzer/test/src/diagnostics/const_with_non_type_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/const_with_non_type_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class ConstWithNonTypeTest extends PubPackageResolutionTest {
   test_fromLibrary() async {
-    newFile2('$testPackageLibPath/lib1.dart', '');
+    newFile('$testPackageLibPath/lib1.dart', '');
     await assertErrorsInCode('''
 import 'lib1.dart' as lib;
 void f() {
diff --git a/pkg/analyzer/test/src/diagnostics/const_with_undefined_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/const_with_undefined_constructor_test.dart
index 29c62ef..53fb4ba 100644
--- a/pkg/analyzer/test/src/diagnostics/const_with_undefined_constructor_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/const_with_undefined_constructor_test.dart
@@ -75,7 +75,7 @@
   }
 
   test_unnamed_prefixed() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class A {
   const A.name();
 }
diff --git a/pkg/analyzer/test/src/diagnostics/could_not_infer_test.dart b/pkg/analyzer/test/src/diagnostics/could_not_infer_test.dart
index 768c741..b1bd6fe 100644
--- a/pkg/analyzer/test/src/diagnostics/could_not_infer_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/could_not_infer_test.dart
@@ -19,7 +19,7 @@
 @reflectiveTest
 class CouldNotInferTest extends PubPackageResolutionTest {
   test_constructor_nullSafe_fromLegacy() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class C<T extends Object> {
   C(T t);
 }
@@ -46,7 +46,7 @@
   }
 
   test_functionType_optOutOfGenericMetadata() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 void f<X>() {}
 ''');
     await assertErrorsInCode('''
@@ -224,7 +224,7 @@
   }
 
   test_functionType_parameterIsObject_returnIsBound_prefixedFunction() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 external T f<T extends num>(T a, T b);
 ''');
     await assertErrorsInCode('''
diff --git a/pkg/analyzer/test/src/diagnostics/dead_code_test.dart b/pkg/analyzer/test/src/diagnostics/dead_code_test.dart
index 3483ddf..633998d 100644
--- a/pkg/analyzer/test/src/diagnostics/dead_code_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/dead_code_test.dart
@@ -315,7 +315,7 @@
   }
 
   test_deadBlock_if_debugConst_prefixedIdentifier2() async {
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 class A {
   static const bool DEBUG = false;
 }''');
@@ -327,7 +327,7 @@
   }
 
   test_deadBlock_if_debugConst_propertyAccessor() async {
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 class A {
   static const bool DEBUG = false;
 }''');
diff --git a/pkg/analyzer/test/src/diagnostics/dead_null_aware_expression_test.dart b/pkg/analyzer/test/src/diagnostics/dead_null_aware_expression_test.dart
index 7cfa142..a82fb28 100644
--- a/pkg/analyzer/test/src/diagnostics/dead_null_aware_expression_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/dead_null_aware_expression_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class DeadNullAwareExpressionTest extends PubPackageResolutionTest {
   test_assignCompound_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 var x = 0;
 ''');
@@ -64,7 +64,7 @@
   }
 
   test_binary_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 var x = 0;
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/deferred_import_of_extension_test.dart b/pkg/analyzer/test/src/diagnostics/deferred_import_of_extension_test.dart
index 702d49f..129320e 100644
--- a/pkg/analyzer/test/src/diagnostics/deferred_import_of_extension_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/deferred_import_of_extension_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class DeferredImportOfExtensionTest extends PubPackageResolutionTest {
   test_deferredImport_withExtensions() {
-    newFile2('$testPackageLibPath/foo.dart', '''
+    newFile('$testPackageLibPath/foo.dart', '''
 extension E on C {}
 class C {}
 ''');
@@ -32,7 +32,7 @@
   }
 
   test_deferredImport_withHiddenExtensions() {
-    newFile2('$testPackageLibPath/foo.dart', '''
+    newFile('$testPackageLibPath/foo.dart', '''
 extension E on C {}
 class C {}
 ''');
@@ -46,7 +46,7 @@
   }
 
   test_deferredImport_withoutExtensions() {
-    newFile2('$testPackageLibPath/foo.dart', '''
+    newFile('$testPackageLibPath/foo.dart', '''
 class C {}
 ''');
     assertNoErrorsInCode('''
@@ -59,7 +59,7 @@
   }
 
   test_deferredImport_withShownNonExtensions() {
-    newFile2('$testPackageLibPath/foo.dart', '''
+    newFile('$testPackageLibPath/foo.dart', '''
 extension E on C {}
 class C {}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart b/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart
index d1364a8..a2dee38 100644
--- a/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/deprecated_member_use_test.dart
@@ -38,7 +38,7 @@
 class DeprecatedMemberUse_BasicWorkspaceTest extends PubPackageResolutionTest
     with DeprecatedMemberUse_BasicWorkspaceTestCases {
   test_instanceCreation_namedParameter_fromLegacy() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   A({@deprecated int a}) {}
 }
@@ -57,7 +57,7 @@
   }
 
   test_methodInvocation_namedParameter_ofFunction_fromLegacy() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 void foo({@deprecated int a}) {}
 ''');
 
@@ -74,7 +74,7 @@
   }
 
   test_methodInvocation_namedParameter_ofMethod_fromLegacy() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   void foo({@deprecated int a}) {}
 }
@@ -93,7 +93,7 @@
   }
 
   test_superConstructorInvocation_namedParameter_fromLegacy() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   A({@deprecated int a}) {}
 }
@@ -124,7 +124,7 @@
   }
 
   test_export() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 @deprecated
 library a;
 ''');
@@ -137,7 +137,7 @@
   }
 
   test_field_inDeprecatedConstructor() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   @deprecated
   int x = 0;
@@ -158,7 +158,7 @@
   }
 
   test_fieldGet_implicitGetter() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   @deprecated
   int foo = 0;
@@ -177,7 +177,7 @@
   }
 
   test_fieldSet_implicitSetter() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   @deprecated
   int foo = 0;
@@ -196,7 +196,7 @@
   }
 
   test_import() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 @deprecated
 library a;
 ''');
@@ -211,7 +211,7 @@
   }
 
   test_method_inDeprecatedConstructor() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   @deprecated
   void foo() {}
@@ -231,7 +231,7 @@
   }
 
   test_methodInvocation() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   @deprecated
   void foo() {}
@@ -250,7 +250,7 @@
   }
 
   test_methodInvocation_withMessage() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   @Deprecated('0.9')
   void foo() {}
@@ -269,7 +269,7 @@
   }
 
   test_parameter_named_ofFunction() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 void foo({@deprecated int a}) {}
 ''');
 
@@ -285,7 +285,7 @@
   }
 
   test_parameter_named_ofMethod() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   void foo({@deprecated int a}) {}
 }
@@ -303,7 +303,7 @@
   }
 
   test_setterInvocation() async {
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 class A {
   @deprecated
   set foo(int _) {}
@@ -332,7 +332,7 @@
 class DeprecatedMemberUse_BazelWorkspaceTest
     extends BazelWorkspaceResolutionTest {
   test_dart() async {
-    newFile2('$workspaceRootPath/foo/bar/lib/a.dart', r'''
+    newFile('$workspaceRootPath/foo/bar/lib/a.dart', r'''
 @deprecated
 class A {}
 ''');
@@ -347,7 +347,7 @@
   }
 
   test_thirdPartyDart() async {
-    newFile2('$workspaceThirdPartyDartPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceThirdPartyDartPath/aaa/lib/a.dart', r'''
 @deprecated
 class A {}
 ''');
@@ -386,17 +386,17 @@
 
   test_differentPackage() async {
     newPubspecYamlFile('$workspaceRootPath/my', '');
-    newFile2('$workspaceRootPath/my/BUILD.gn', '');
+    newFile('$workspaceRootPath/my/BUILD.gn', '');
 
     newPubspecYamlFile('$workspaceRootPath/aaa', '');
-    newFile2('$workspaceRootPath/aaa/BUILD.gn', '');
+    newFile('$workspaceRootPath/aaa/BUILD.gn', '');
 
     _writeWorkspacePackagesFile({
       'aaa': '$workspaceRootPath/aaa/lib',
       'my': myPackageLibPath,
     });
 
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 @deprecated
 class A {}
 ''');
@@ -412,13 +412,13 @@
 
   test_samePackage() async {
     newPubspecYamlFile('$workspaceRootPath/my', '');
-    newFile2('$workspaceRootPath/my/BUILD.gn', '');
+    newFile('$workspaceRootPath/my/BUILD.gn', '');
 
     _writeWorkspacePackagesFile({
       'my': myPackageLibPath,
     });
 
-    newFile2('$myPackageLibPath/a.dart', r'''
+    newFile('$myPackageLibPath/a.dart', r'''
 @deprecated
 class A {}
 ''');
@@ -448,7 +448,7 @@
 
     var buildDir = 'out/debug-x87_128';
     var genPath = '$workspaceRootPath/$buildDir/dartlang/gen';
-    newFile2('$genPath/foo_package_config.json', '''{
+    newFile('$genPath/foo_package_config.json', '''{
   "configVersion": 2,
   "packages": [ ${packages.join(', ')} ]
 }''');
@@ -489,7 +489,7 @@
         ..add(name: 'aaa', rootPath: '$workspaceRootPath/aaa'),
     );
 
-    newFile2('$workspaceRootPath/aaa/lib/a.dart', r'''
+    newFile('$workspaceRootPath/aaa/lib/a.dart', r'''
 @deprecated
 class A {}
 ''');
@@ -597,7 +597,7 @@
   }
 
   test_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 @deprecated
 class A {}
 ''');
@@ -627,7 +627,7 @@
   }
 
   test_export() async {
-    newFile2('$testPackageLibPath/deprecated_library.dart', r'''
+    newFile('$testPackageLibPath/deprecated_library.dart', r'''
 @deprecated
 library deprecated_library;
 class A {}
@@ -713,7 +713,7 @@
   }
 
   test_hideCombinator() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 @deprecated
 class A {}
 ''');
@@ -725,7 +725,7 @@
   }
 
   test_import() async {
-    newFile2('$testPackageLibPath/deprecated_library.dart', r'''
+    newFile('$testPackageLibPath/deprecated_library.dart', r'''
 @deprecated
 library deprecated_library;
 class A {}
@@ -1235,7 +1235,7 @@
   }
 
   test_showCombinator() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 @deprecated
 class A {}
 ''');
@@ -1559,7 +1559,7 @@
 class DeprecatedMemberUseFromSamePackage_BazelWorkspaceTest
     extends BazelWorkspaceResolutionTest {
   test_it() async {
-    newFile2('$myPackageLibPath/a.dart', r'''
+    newFile('$myPackageLibPath/a.dart', r'''
 @deprecated
 class A {}
 ''');
@@ -1602,7 +1602,7 @@
     newPubspecYamlFile(testPackageRootPath, 'name: test');
     _createTestPackageBuildMarker();
 
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 @deprecated
 class A {}
 ''');
@@ -1637,7 +1637,7 @@
     required String pathInLib,
     required String content,
   }) {
-    newFile2(
+    newFile(
       '$testPackageGeneratedPath/$packageName/lib/$pathInLib',
       content,
     );
diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_definition_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_definition_test.dart
index 34cbd6e..3b4dac7 100644
--- a/pkg/analyzer/test/src/diagnostics/duplicate_definition_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/duplicate_definition_test.dart
@@ -1556,12 +1556,12 @@
   test_unitMembers_part_library() async {
     var libPath = convertPath('$testPackageLibPath/lib.dart');
     var aPath = convertPath('$testPackageLibPath/a.dart');
-    newFile2(libPath, '''
+    newFile(libPath, '''
 part 'a.dart';
 
 class A {}
 ''');
-    newFile2(aPath, '''
+    newFile(aPath, '''
 part of 'lib.dart';
 
 class A {}
@@ -1581,16 +1581,16 @@
     var libPath = convertPath('$testPackageLibPath/lib.dart');
     var aPath = convertPath('$testPackageLibPath/a.dart');
     var bPath = convertPath('$testPackageLibPath/b.dart');
-    newFile2(libPath, '''
+    newFile(libPath, '''
 part 'a.dart';
 part 'b.dart';
 ''');
-    newFile2(aPath, '''
+    newFile(aPath, '''
 part of 'lib.dart';
 
 class A {}
 ''');
-    newFile2(bPath, '''
+    newFile(bPath, '''
 part of 'lib.dart';
 
 class A {}
diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_hidden_name_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_hidden_name_test.dart
index f607d26..e1357da 100644
--- a/pkg/analyzer/test/src/diagnostics/duplicate_hidden_name_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/duplicate_hidden_name_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class DuplicateHiddenNameTest extends PubPackageResolutionTest {
   test_hidden() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 class B {}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_import_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_import_test.dart
index 343555d..a403bd1 100644
--- a/pkg/analyzer/test/src/diagnostics/duplicate_import_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/duplicate_import_test.dart
@@ -17,11 +17,11 @@
 @reflectiveTest
 class DuplicateImportTest extends PubPackageResolutionTest {
   test_duplicateImport() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 library lib1;
 class A {}''');
 
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 library L;
 import 'lib1.dart';
 import 'lib1.dart';
@@ -34,13 +34,13 @@
   }
 
   test_importsHaveIdenticalShowHide() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 library lib1;
 class A {}
 class B {}
 ''');
 
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 library L;
 import 'lib1.dart' as M show A hide B;
 import 'lib1.dart' as M show A hide B;
@@ -54,12 +54,12 @@
   }
 
   test_oneImportHasHide() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 library lib1;
 class A {}
 class B {}''');
 
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 library L;
 import 'lib1.dart';
 import 'lib1.dart' hide A;
@@ -71,13 +71,13 @@
   }
 
   test_oneImportHasShow() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 library lib1;
 class A {}
 class B {}
 ''');
 
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 library L;
 import 'lib1.dart';
 import 'lib1.dart' show A; // ignore: unnecessary_import
@@ -90,11 +90,11 @@
   }
 
   test_oneImportUsesAs() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 library lib1;
 class A {}''');
 
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 library L;
 import 'lib1.dart';
 import 'lib1.dart' as one;
@@ -107,11 +107,11 @@
   }
 
   test_twoDuplicateImports() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 library lib1;
 class A {}''');
 
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 library L;
 import 'lib1.dart';
 import 'lib1.dart';
diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_part_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_part_test.dart
index 19acede..5c843d9 100644
--- a/pkg/analyzer/test/src/diagnostics/duplicate_part_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/duplicate_part_test.dart
@@ -16,10 +16,10 @@
 @reflectiveTest
 class DuplicatePartTest extends PubPackageResolutionTest {
   test_no_duplicates() async {
-    newFile2('$testPackageLibPath/part1.dart', '''
+    newFile('$testPackageLibPath/part1.dart', '''
 part of lib;
 ''');
-    newFile2('$testPackageLibPath/part2.dart', '''
+    newFile('$testPackageLibPath/part2.dart', '''
 part of lib;
 ''');
     await assertNoErrorsInCode(r'''
@@ -30,7 +30,7 @@
   }
 
   test_sameSource() async {
-    newFile2('$testPackageLibPath/part.dart', 'part of lib;');
+    newFile('$testPackageLibPath/part.dart', 'part of lib;');
     await assertErrorsInCode(r'''
 library lib;
 part 'part.dart';
@@ -41,7 +41,7 @@
   }
 
   test_sameUri() async {
-    newFile2('$testPackageLibPath/part.dart', 'part of lib;');
+    newFile('$testPackageLibPath/part.dart', 'part of lib;');
     await assertErrorsInCode(r'''
 library lib;
 part 'part.dart';
diff --git a/pkg/analyzer/test/src/diagnostics/duplicate_shown_name_test.dart b/pkg/analyzer/test/src/diagnostics/duplicate_shown_name_test.dart
index 5a6f20b..68ba3d6 100644
--- a/pkg/analyzer/test/src/diagnostics/duplicate_shown_name_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/duplicate_shown_name_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class DuplicateShownNameTest extends PubPackageResolutionTest {
   test_hidden() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 class B {}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/export_legacy_symbol_test.dart b/pkg/analyzer/test/src/diagnostics/export_legacy_symbol_test.dart
index c7549ef..17be44d 100644
--- a/pkg/analyzer/test/src/diagnostics/export_legacy_symbol_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/export_legacy_symbol_test.dart
@@ -28,7 +28,7 @@
   }
 
   test_exportOptedIn() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -37,11 +37,11 @@
   }
 
   test_exportOptedOut_exportOptedIn_hasLegacySymbol() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 // @dart = 2.5
 export 'a.dart';
 class B {}
@@ -55,11 +55,11 @@
   }
 
   test_exportOptedOut_exportOptedIn_hideLegacySymbol() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 // @dart = 2.5
 export 'a.dart';
 class B {}
@@ -71,7 +71,7 @@
   }
 
   test_exportOptedOut_hasLegacySymbol() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 class A {}
 class B {}
diff --git a/pkg/analyzer/test/src/diagnostics/export_of_non_library_test.dart b/pkg/analyzer/test/src/diagnostics/export_of_non_library_test.dart
index dbc6573..bf600cd 100644
--- a/pkg/analyzer/test/src/diagnostics/export_of_non_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/export_of_non_library_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class ExportOfNonLibraryTest extends PubPackageResolutionTest {
   test_export_of_non_library() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 part of lib;
 ''');
     await assertErrorsInCode(r'''
@@ -29,7 +29,7 @@
   }
 
   test_libraryDeclared() async {
-    newFile2('$testPackageLibPath/lib1.dart', "library lib1;");
+    newFile('$testPackageLibPath/lib1.dart', "library lib1;");
     await assertNoErrorsInCode(r'''
 library L;
 export 'lib1.dart';
@@ -37,7 +37,7 @@
   }
 
   test_libraryNotDeclared() async {
-    newFile2('$testPackageLibPath/lib1.dart', '');
+    newFile('$testPackageLibPath/lib1.dart', '');
     await assertNoErrorsInCode(r'''
 library L;
 export 'lib1.dart';
diff --git a/pkg/analyzer/test/src/diagnostics/extends_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/extends_deferred_class_test.dart
index 798558b..8685f61 100644
--- a/pkg/analyzer/test/src/diagnostics/extends_deferred_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/extends_deferred_class_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class ExtendsDeferredClassTest extends PubPackageResolutionTest {
   test_classTypeAlias() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}
 ''');
@@ -31,7 +31,7 @@
   }
 
   test_extends_deferred_class() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}
 ''');
@@ -45,7 +45,7 @@
   }
 
   test_extends_deferred_interfaceTypeTypedef() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}
 class B {}
diff --git a/pkg/analyzer/test/src/diagnostics/extends_non_class_test.dart b/pkg/analyzer/test/src/diagnostics/extends_non_class_test.dart
index 62547b2..3562a313 100644
--- a/pkg/analyzer/test/src/diagnostics/extends_non_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/extends_non_class_test.dart
@@ -128,7 +128,7 @@
   }
 
   test_undefined_ignore_part_exists_uriGenerated_nameIgnorable() async {
-    newFile2('$testPackageLibPath/a.g.dart', r'''
+    newFile('$testPackageLibPath/a.g.dart', r'''
 part of 'test.dart';
 ''');
 
diff --git a/pkg/analyzer/test/src/diagnostics/extension_as_expression_test.dart b/pkg/analyzer/test/src/diagnostics/extension_as_expression_test.dart
index 4c9374b..46a0a4c 100644
--- a/pkg/analyzer/test/src/diagnostics/extension_as_expression_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/extension_as_expression_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class ExtensionAsExpressionTest extends PubPackageResolutionTest {
   test_prefixedIdentifier() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E on int {}
 ''');
     await assertErrorsInCode('''
diff --git a/pkg/analyzer/test/src/diagnostics/generic_function_type_cannot_be_bound_test.dart b/pkg/analyzer/test/src/diagnostics/generic_function_type_cannot_be_bound_test.dart
index d32935b..72b42ee 100644
--- a/pkg/analyzer/test/src/diagnostics/generic_function_type_cannot_be_bound_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/generic_function_type_cannot_be_bound_test.dart
@@ -32,7 +32,7 @@
   }
 
   test_genericFunction_optOutOfGenericMetadata() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 typedef F = S Function<S>(S);
 ''');
     await assertErrorsInCode('''
diff --git a/pkg/analyzer/test/src/diagnostics/getter_not_assignable_setter_types_test.dart b/pkg/analyzer/test/src/diagnostics/getter_not_assignable_setter_types_test.dart
index 876c26e..c63e730 100644
--- a/pkg/analyzer/test/src/diagnostics/getter_not_assignable_setter_types_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/getter_not_assignable_setter_types_test.dart
@@ -54,7 +54,7 @@
   }
 
   test_class_instance_private_getter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int get _foo => 0;
 }
@@ -71,12 +71,12 @@
   }
 
   test_class_instance_private_interfaces() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int get _foo => 0;
 }
 ''');
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 class B {
   set _foo(String _) {}
 }
@@ -90,7 +90,7 @@
   }
 
   test_class_instance_private_interfaces2() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int get _foo => 0;
 }
@@ -107,7 +107,7 @@
   }
 
   test_class_instance_private_setter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   set _foo(String _) {}
 }
diff --git a/pkg/analyzer/test/src/diagnostics/getter_not_subtype_setter_types_test.dart b/pkg/analyzer/test/src/diagnostics/getter_not_subtype_setter_types_test.dart
index 7f6a0b0..cd0b774 100644
--- a/pkg/analyzer/test/src/diagnostics/getter_not_subtype_setter_types_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/getter_not_subtype_setter_types_test.dart
@@ -74,7 +74,7 @@
   }
 
   test_class_instance_private_getter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int get _foo => 0;
 }
@@ -91,12 +91,12 @@
   }
 
   test_class_instance_private_interfaces() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int get _foo => 0;
 }
 ''');
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 class B {
   set _foo(String _) {}
 }
@@ -110,7 +110,7 @@
   }
 
   test_class_instance_private_interfaces2() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int get _foo => 0;
 }
@@ -127,7 +127,7 @@
   }
 
   test_class_instance_private_setter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   set _foo(String _) {}
 }
diff --git a/pkg/analyzer/test/src/diagnostics/if_element_condition_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/if_element_condition_from_deferred_library_test.dart
index db0c21d..80176d0 100644
--- a/pkg/analyzer/test/src/diagnostics/if_element_condition_from_deferred_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/if_element_condition_from_deferred_library_test.dart
@@ -20,7 +20,7 @@
 mixin IfElementConditionFromDeferredLibraryTestCases
     on PubPackageResolutionTest {
   test_inList_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const bool c = true;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -33,7 +33,7 @@
   }
 
   test_inList_nonConst() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const bool c = true;''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -43,7 +43,7 @@
   }
 
   test_inList_notDeferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const bool c = true;''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' as a;
@@ -53,7 +53,7 @@
   }
 
   test_inMap_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const bool c = true;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -66,7 +66,7 @@
   }
 
   test_inMap_notConst() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const bool c = true;''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -76,7 +76,7 @@
   }
 
   test_inMap_notDeferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const bool c = true;''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' as a;
@@ -86,7 +86,7 @@
   }
 
   test_inSet_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const bool c = true;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -99,7 +99,7 @@
   }
 
   test_inSet_notConst() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const bool c = true;''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -109,7 +109,7 @@
   }
 
   test_inSet_notDeferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const bool c = true;''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' as a;
diff --git a/pkg/analyzer/test/src/diagnostics/implements_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/implements_deferred_class_test.dart
index da1430f..d9e36f7 100644
--- a/pkg/analyzer/test/src/diagnostics/implements_deferred_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/implements_deferred_class_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class ImplementsDeferredClassTest extends PubPackageResolutionTest {
   test_class_implements() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}
 ''');
@@ -30,7 +30,7 @@
   }
 
   test_class_implements_interfaceTypeTypedef() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}
 typedef B = A;
@@ -45,7 +45,7 @@
   }
 
   test_classTypeAlias() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/import_deferred_library_with_load_function_test.dart b/pkg/analyzer/test/src/diagnostics/import_deferred_library_with_load_function_test.dart
index 388dd30..5840d12 100644
--- a/pkg/analyzer/test/src/diagnostics/import_deferred_library_with_load_function_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/import_deferred_library_with_load_function_test.dart
@@ -17,7 +17,7 @@
 class ImportDeferredLibraryWithLoadFunctionTest
     extends PubPackageResolutionTest {
   test_deferredImport_withLoadLibraryFunction() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void loadLibrary() {}
 void f() {}
 ''');
@@ -33,7 +33,7 @@
   }
 
   test_deferredImport_withLoadLibraryFunction_hide() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void loadLibrary() {}
 void f() {}
 ''');
@@ -47,7 +47,7 @@
   }
 
   test_deferredImport_withLoadLibraryFunction_hide2() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void loadLibrary() {}
 void f() {}
 void f2() {}
@@ -64,7 +64,7 @@
   }
 
   test_deferredImport_withLoadLibraryFunction_show() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void loadLibrary() {}
 void f() {}
 ''');
@@ -78,7 +78,7 @@
   }
 
   test_deferredImport_withoutLoadLibraryFunction() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void f() {}
 ''');
 
@@ -91,7 +91,7 @@
   }
 
   test_nonDeferredImport_withLoadLibraryFunction() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void loadLibrary() {}
 void f() {}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/import_of_legacy_library_into_null_safe_test.dart b/pkg/analyzer/test/src/diagnostics/import_of_legacy_library_into_null_safe_test.dart
index e56a81d..ed32222 100644
--- a/pkg/analyzer/test/src/diagnostics/import_of_legacy_library_into_null_safe_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/import_of_legacy_library_into_null_safe_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class ImportOfLegacyLibraryInoNullSafeTest extends PubPackageResolutionTest {
   test_legacy_into_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.9
 class A {}
 ''');
@@ -29,7 +29,7 @@
   }
 
   test_legacy_into_nullSafe() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.9
 class A {}
 ''');
@@ -43,7 +43,7 @@
   }
 
   test_nullSafe_into_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -55,7 +55,7 @@
   }
 
   test_nullSafe_into_nullSafe() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -66,9 +66,9 @@
   }
 
   test_nullSafe_into_nullSafe_part() async {
-    newFile2('$testPackageLibPath/a.dart', '');
+    newFile('$testPackageLibPath/a.dart', '');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 part of 'test.dart';
 import 'a.dart';
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/import_of_non_library_test.dart b/pkg/analyzer/test/src/diagnostics/import_of_non_library_test.dart
index 77f8322..4a21c67 100644
--- a/pkg/analyzer/test/src/diagnostics/import_of_non_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/import_of_non_library_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class ImportOfNonLibraryTest extends PubPackageResolutionTest {
   test_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 part of lib;
 class A {}
 ''');
@@ -31,7 +31,7 @@
   }
 
   test_part() async {
-    newFile2('$testPackageLibPath/part.dart', r'''
+    newFile('$testPackageLibPath/part.dart', r'''
 part of lib;
 class A{}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/inconsistent_case_expression_types_test.dart b/pkg/analyzer/test/src/diagnostics/inconsistent_case_expression_types_test.dart
index 805135e..f0abbbc 100644
--- a/pkg/analyzer/test/src/diagnostics/inconsistent_case_expression_types_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/inconsistent_case_expression_types_test.dart
@@ -17,7 +17,7 @@
 @reflectiveTest
 class InconsistentCaseExpressionTypesTest extends PubPackageResolutionTest {
   test_int_none_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const a = 0;
 ''');
 
diff --git a/pkg/analyzer/test/src/diagnostics/inconsistent_language_version_override_test.dart b/pkg/analyzer/test/src/diagnostics/inconsistent_language_version_override_test.dart
index e71a823..c67f418 100644
--- a/pkg/analyzer/test/src/diagnostics/inconsistent_language_version_override_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/inconsistent_language_version_override_test.dart
@@ -103,9 +103,9 @@
     var libraryPath = convertPath('$testPackageLibPath/a.dart');
     var partPath = convertPath('$testPackageLibPath/b.dart');
 
-    newFile2(libraryPath, libraryContent);
+    newFile(libraryPath, libraryContent);
 
-    newFile2(partPath, partContent);
+    newFile(partPath, partContent);
 
     await assertErrorsInFile2(libraryPath, libraryErrors);
   }
diff --git a/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_invocation_test.dart b/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_invocation_test.dart
index 83ddae8..3dcf6c8 100644
--- a/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_invocation_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/inference_failure_on_function_invocation_test.dart
@@ -224,7 +224,7 @@
   }
 
   test_topLevelFunction_withImportPrefix_noInference() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 void f<T>() {}
 ''');
     await assertErrorsInCode('''
@@ -238,7 +238,7 @@
   }
 
   test_topLevelFunction_withImportPrefix_optionalTypeArgs() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 @optionalTypeArgs
 void f<T>() {}
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_annotation_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_annotation_from_deferred_library_test.dart
index 31828e1..0d9c533 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_annotation_from_deferred_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_annotation_from_deferred_library_test.dart
@@ -17,7 +17,7 @@
 class InvalidAnnotationFromDeferredLibraryTest
     extends PubPackageResolutionTest {
   test_constructor() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class C { const C(); }
 ''');
@@ -32,7 +32,7 @@
   }
 
   test_constructor_argument() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 const x = 0;
 ''');
     await assertErrorsInCode('''
@@ -50,7 +50,7 @@
   }
 
   test_from_deferred_library() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class V { const V(); }
 const v = const V();
@@ -66,7 +66,7 @@
   }
 
   test_namedConstructor() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class C { const C.name(); }
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_annotation_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_annotation_test.dart
index 6212082..712815a 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_annotation_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_annotation_test.dart
@@ -66,7 +66,7 @@
   }
 
   test_getter_importWithPrefix() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 library lib;
 get V => 0;
 ''');
@@ -81,7 +81,7 @@
   }
 
   test_importWithPrefix_notConstantVariable() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 library lib;
 final V = 0;
 ''');
@@ -96,7 +96,7 @@
   }
 
   test_importWithPrefix_notVariableOrConstructorInvocation() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 library lib;
 typedef V();
 ''');
@@ -145,7 +145,7 @@
   }
 
   test_notClass_importWithPrefix() async {
-    newFile2('$testPackageLibPath/annotations.dart', r'''
+    newFile('$testPackageLibPath/annotations.dart', r'''
 class Property {
   final int value;
   const Property(this.value);
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_constant_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_constant_test.dart
index 3958315..a6df4c8 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_constant_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_constant_test.dart
@@ -61,7 +61,7 @@
   }
 
   test_in_initializer_from_deferred_library_field() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 const int c = 1;''');
     await assertErrorsInCode('''
@@ -77,7 +77,7 @@
   }
 
   test_in_initializer_from_deferred_library_field_nested() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 const int c = 1;
 ''');
@@ -94,7 +94,7 @@
   }
 
   test_in_initializer_from_deferred_library_redirecting() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 const int c = 1;
 ''');
@@ -111,7 +111,7 @@
   }
 
   test_in_initializer_from_deferred_library_super() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 const int c = 1;
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_export_of_internal_element_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_export_of_internal_element_test.dart
index 2f9fb0c..1437172 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_export_of_internal_element_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_export_of_internal_element_test.dart
@@ -36,12 +36,12 @@
     MockPackages.addMetaPackageFiles(
       getFolder(metaPath),
     );
-    newFile2('$testPackageBazelBinPath/my.packages', '');
+    newFile('$testPackageBazelBinPath/my.packages', '');
     newFolder('$workspaceRootPath/bazel-out');
   }
 
   void test_exporterIsInBazelBinLib() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -56,7 +56,7 @@
   }
 
   void test_exporterIsInBazelBinLibSrc() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -69,7 +69,7 @@
   }
 
   void test_exporterIsInGenfilesLib() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -84,7 +84,7 @@
   }
 
   void test_exporterIsInGenfilesLibSrc() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -97,7 +97,7 @@
   }
 
   void test_exporterIsInLib() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -112,7 +112,7 @@
   }
 
   void test_exporterIsInLibSrc() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -125,7 +125,7 @@
   }
 
   void test_exporterIsInTest() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -138,7 +138,7 @@
   }
 
   void test_internalIsInBazelBin() async {
-    newFile2('$testPackageBazelBinPath/lib/src/foo.dart', r'''
+    newFile('$testPackageBazelBinPath/lib/src/foo.dart', r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -151,7 +151,7 @@
   }
 
   void test_internalIsInGenfiles() async {
-    newFile2('$testPackageGenfilesPath/lib/src/foo.dart', r'''
+    newFile('$testPackageGenfilesPath/lib/src/foo.dart', r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -164,7 +164,7 @@
   }
 
   void test_internalIsInLibSrc() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -188,7 +188,7 @@
 analysis. So, there is no context to analyze it.
 ''')
   void test_exporterInGeneratedLib() async {
-    newFile2('$testPackageRootPath/lib/src/foo.dart', r'''
+    newFile('$testPackageRootPath/lib/src/foo.dart', r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -207,7 +207,7 @@
 analysis. So, there is no context to analyze it.
 ''')
   void test_exporterInGeneratedLibSrc() async {
-    newFile2('$testPackageRootPath/lib/src/foo.dart', r'''
+    newFile('$testPackageRootPath/lib/src/foo.dart', r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -220,7 +220,7 @@
   }
 
   void test_exporterInLib() async {
-    newFile2('$testPackageRootPath/lib/src/foo.dart', r'''
+    newFile('$testPackageRootPath/lib/src/foo.dart', r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -235,7 +235,7 @@
   }
 
   void test_exporterInLibSrc() async {
-    newFile2('$testPackageRootPath/lib/src/foo.dart', r'''
+    newFile('$testPackageRootPath/lib/src/foo.dart', r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -248,7 +248,7 @@
   }
 
   void test_internalIsInGeneratedLibSrc() async {
-    newFile2('$testPackageDartToolPath/lib/src/foo.dart', r'''
+    newFile('$testPackageDartToolPath/lib/src/foo.dart', r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -262,7 +262,7 @@
 
   @override
   void test_internalIsLibSrc() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -289,7 +289,7 @@
   }
 
   void test_exporterIsInLib() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -304,7 +304,7 @@
   }
 
   void test_exporterIsInLibSrc() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -317,7 +317,7 @@
   }
 
   void test_exporterIsInTest() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -330,7 +330,7 @@
   }
 
   void test_internalIsLibSrc() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -350,7 +350,7 @@
   String get testPackageLibPath;
 
   void test_hideCombinator_internalHidden() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 class Two {}
@@ -362,7 +362,7 @@
   }
 
   void test_hideCombinator_internalNotHidden() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 class Two {}
@@ -376,7 +376,7 @@
   }
 
   void test_indirectlyViaFunction_parameter() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal typedef int IntFunc(int x);
 int func(IntFunc f, int x) => f(x);
@@ -390,7 +390,7 @@
   }
 
   void test_indirectlyViaFunction_parameter_generic() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal typedef IntFunc = int Function(int);
 int func(IntFunc f, int x) => f(x);
@@ -404,7 +404,7 @@
   }
 
   void test_indirectlyViaFunction_parameter_generic_typeArg() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal typedef IntFunc<T> = int Function(T);
 int func(IntFunc<num> f, int x) => f(x);
@@ -418,7 +418,7 @@
   }
 
   void test_indirectlyViaFunction_returnType() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal typedef int IntFunc(int x);
 IntFunc func() => (int x) => x;
@@ -432,7 +432,7 @@
   }
 
   void test_indirectlyViaFunction_typeArgument_bounded() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal typedef int IntFunc(int x);
 void func<T extends IntFunc>() {}
@@ -446,7 +446,7 @@
   }
 
   void test_indirectlyViaFunction_typeArgument_unbounded() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal typedef int IntFunc(int x);
 void func<T>() {}
@@ -458,7 +458,7 @@
   }
 
   void test_noCombinators() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -471,11 +471,11 @@
   }
 
   void test_noCombinators_indirectExport() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 export 'bar.dart';
 ''');
 
-    newFile2('$testPackageLibPath/src/bar.dart', r'''
+    newFile('$testPackageLibPath/src/bar.dart', r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 ''');
@@ -488,7 +488,7 @@
   }
 
   void test_noCombinators_library() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 @internal
 library foo;
 
@@ -503,7 +503,7 @@
   }
 
   void test_noCombinators_library_notInternal() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 library foo;
 ''');
 
@@ -513,7 +513,7 @@
   }
 
   void test_noCombinators_noInternal() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 class One {}
 ''');
 
@@ -523,7 +523,7 @@
   }
 
   void test_showCombinator_internalNotShown() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 class Two {}
@@ -535,7 +535,7 @@
   }
 
   void test_showCombinator_internalShown() async {
-    newFile2(testPackageImplementationFilePath, r'''
+    newFile(testPackageImplementationFilePath, r'''
 import 'package:meta/meta.dart';
 @internal class One {}
 class Two {}
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_null_aware_operator_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_null_aware_operator_test.dart
index 7343ea7..60e0fd0 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_null_aware_operator_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_null_aware_operator_test.dart
@@ -195,7 +195,7 @@
   }
 
   test_getter_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 var x = 0;
 ''');
@@ -249,7 +249,7 @@
   /// report [StaticWarningCode.INVALID_NULL_AWARE_OPERATOR]. But we also
   /// report another error.
   test_getter_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int x = 0;
 ''');
     await assertErrorsInCode('''
@@ -264,7 +264,7 @@
   }
 
   test_index_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 var x = [0];
 ''');
@@ -327,7 +327,7 @@
   }
 
   test_method_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 var x = 0;
 ''');
@@ -386,7 +386,7 @@
   }
 
   test_nullableSpread_legacyType() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 var x = <int>[];
 ''');
@@ -460,7 +460,7 @@
   /// report [StaticWarningCode.INVALID_NULL_AWARE_OPERATOR]. But we also
   /// report another error.
   test_setter_prefix() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int x = 0;
 ''');
     await assertErrorsInCode('''
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_override_different_default_values_named_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_override_different_default_values_named_test.dart
index 57bb470..f0ab80b0 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_override_different_default_values_named_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_override_different_default_values_named_test.dart
@@ -20,7 +20,7 @@
 class InvalidOverrideDifferentDefaultValuesNamedTest
     extends InvalidOverrideDifferentDefaultValuesNamedWithoutNullSafetyTest {
   test_concrete_equal_optIn_extends_optOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 class A {
   void foo({int a = 0}) {}
@@ -39,7 +39,7 @@
   }
 
   test_concrete_equal_optOut_extends_optIn() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void foo({int a = 0}) {}
 }
@@ -217,7 +217,7 @@
   }
 
   test_concrete_equal_otherLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void foo([a = 0]) {}
 }
@@ -232,7 +232,7 @@
   }
 
   test_concrete_equal_otherLibrary_listLiteral() async {
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 class C {
   void foo({x: const ['x']}) {}
 }
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_override_different_default_values_positional_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_override_different_default_values_positional_test.dart
index 11b7180..ddd6517 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_override_different_default_values_positional_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_override_different_default_values_positional_test.dart
@@ -22,7 +22,7 @@
 class InvalidOverrideDifferentDefaultValuesPositionalTest
     extends InvalidOverrideDifferentDefaultValuesPositionalWithoutNullSafetyTest {
   test_concrete_equal_optIn_extends_optOut() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 class A {
   void foo([int a = 0]) {}
@@ -41,7 +41,7 @@
   }
 
   test_concrete_equal_optOut_extends_optIn() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void foo([int a = 0]) {}
 }
@@ -231,7 +231,7 @@
   }
 
   test_concrete_equal_otherLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void foo([x = 0]) {}
 }
@@ -246,7 +246,7 @@
   }
 
   test_concrete_equal_otherLibrary_listLiteral() async {
-    newFile2('$testPackageLibPath/other.dart', '''
+    newFile('$testPackageLibPath/other.dart', '''
 class C {
   void foo([x = const ['x']]) {}
 }
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart
index 9725362..7a6a04d 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_override_test.dart
@@ -215,7 +215,7 @@
   }
 
   test_method_parameter_functionTyped_optOut_extends_optIn() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 abstract class A {
   A catchError(void Function(Object) a);
 }
@@ -232,7 +232,7 @@
   }
 
   test_method_parameter_interfaceOptOut_concreteOptIn() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void foo(Object a) {}
 }
@@ -249,7 +249,7 @@
   }
 
   test_mixedInheritance_1() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class B {
   List<int Function(int)> get a => [];
   set a(List<int Function(int)> _) {}
@@ -263,7 +263,7 @@
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 // @dart = 2.7
 import 'a.dart';
 
@@ -281,7 +281,7 @@
   }
 
   test_mixedInheritance_2() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class B {
   List<int Function(int)> get a => [];
   set a(List<int Function(int)> _) {}
@@ -295,7 +295,7 @@
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 // @dart = 2.7
 import 'a.dart';
 
@@ -416,7 +416,7 @@
   }
 
   test_viaLegacy_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A1 {
   int m() => 0;
   int get g => 0;
@@ -430,7 +430,7 @@
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 // @dart=2.6
 import 'a.dart';
 
@@ -455,7 +455,7 @@
   }
 
   test_viaLegacy_mixin() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A1 {
   int m() => 0;
   int get g => 0;
@@ -469,7 +469,7 @@
 }
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 // @dart=2.6
 import 'a.dart';
 
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_internal_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_internal_member_test.dart
index 98da1f6..40d92f9 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_internal_member_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_internal_member_test.dart
@@ -37,12 +37,12 @@
   }
 
   test_insidePackage() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 class A {}
 ''');
-    newFile2('$fooPackageRootPath/lib/a.dart', '''
+    newFile('$fooPackageRootPath/lib/a.dart', '''
 import 'src/a.dart';
 
 A a = A();
@@ -53,7 +53,7 @@
   }
 
   test_outsidePackage_class() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 class A {}
@@ -69,7 +69,7 @@
   }
 
   test_outsidePackage_constructor_named() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal
@@ -87,7 +87,7 @@
   }
 
   test_outsidePackage_constructor_unnamed() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal
@@ -105,7 +105,7 @@
   }
 
   test_outsidePackage_enum() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 enum E {one}
@@ -121,7 +121,7 @@
   }
 
   test_outsidePackage_enumValue() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 enum E {@internal one}
 ''');
@@ -136,7 +136,7 @@
   }
 
   test_outsidePackage_extensionMethod() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 extension E on String {
   @internal
@@ -154,7 +154,7 @@
   }
 
   test_outsidePackage_function() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 int a() => 1;
@@ -170,7 +170,7 @@
   }
 
   test_outsidePackage_function_generic() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 int a<T>() => 1;
@@ -186,7 +186,7 @@
   }
 
   test_outsidePackage_function_generic_tearoff() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 int a<T>() => 1;
@@ -202,7 +202,7 @@
   }
 
   test_outsidePackage_function_tearoff() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 int a() => 1;
@@ -218,7 +218,7 @@
   }
 
   test_outsidePackage_functionLiteralForInternalTypedef() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 @internal
 typedef IntFunc = int Function(int);
 int foo(IntFunc f, int x) => f(x);
@@ -232,7 +232,7 @@
   }
 
   test_outsidePackage_inCommentReference() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 int get a => 1;
@@ -247,7 +247,7 @@
   }
 
   test_outsidePackage_library() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 @internal
 library a;
 import 'package:meta/meta.dart';
@@ -262,7 +262,7 @@
   }
 
   test_outsidePackage_method() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal
@@ -280,7 +280,7 @@
   }
 
   test_outsidePackage_method_generic() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal
@@ -298,7 +298,7 @@
   }
 
   test_outsidePackage_method_subclassed() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal int f() => 1;
@@ -317,7 +317,7 @@
   }
 
   test_outsidePackage_method_subclassed_overridden() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal int f() => 1;
@@ -336,7 +336,7 @@
   }
 
   test_outsidePackage_method_tearoff() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal
@@ -354,7 +354,7 @@
   }
 
   test_outsidePackage_methodParameter_named() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   int m({@internal int a = 0}) => 1;
@@ -372,7 +372,7 @@
 
   @FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/28066')
   test_outsidePackage_methodParameter_positional() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   int m([@internal int a = 0]) => 1;
@@ -389,7 +389,7 @@
   }
 
   test_outsidePackage_mixin() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 mixin A {}
@@ -405,7 +405,7 @@
   }
 
   test_outsidePackage_pairedWithProtected() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal
@@ -426,7 +426,7 @@
   }
 
   test_outsidePackage_redirectingFactoryConstructor() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 import 'package:test/test.dart';
 class D implements C {
@@ -446,7 +446,7 @@
   }
 
   test_outsidePackage_setter() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal
@@ -466,7 +466,7 @@
   }
 
   test_outsidePackage_setter_compound() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   int get s() => 1;
@@ -488,7 +488,7 @@
   }
 
   test_outsidePackage_setter_questionQuestion() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   int get s() => 1;
@@ -510,7 +510,7 @@
   }
 
   test_outsidePackage_superConstructor() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal C();
@@ -529,7 +529,7 @@
   }
 
   test_outsidePackage_superConstructor_named() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 class C {
   @internal C.named();
@@ -548,7 +548,7 @@
   }
 
   test_outsidePackage_topLevelGetter() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 int get a => 1;
@@ -564,7 +564,7 @@
   }
 
   test_outsidePackage_typedef() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 typedef t = void Function();
@@ -581,7 +581,7 @@
 
   @FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/28066')
   test_outsidePackage_typedefParameter() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 typedef T = void Function({@internal int a = 1});
 ''');
@@ -596,7 +596,7 @@
   }
 
   test_outsidePackage_variable() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 int a = 1;
@@ -612,7 +612,7 @@
   }
 
   test_outsidePackage_variable_prefixed() async {
-    newFile2('$fooPackageRootPath/lib/src/a.dart', '''
+    newFile('$fooPackageRootPath/lib/src/a.dart', '''
 import 'package:meta/meta.dart';
 @internal
 int a = 1;
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_protected_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_protected_member_test.dart
index 8b4a8e4..cbf06e1 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_protected_member_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_protected_member_test.dart
@@ -23,7 +23,7 @@
   }
 
   test_closure() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 
 class A {
@@ -31,7 +31,7 @@
   int a() => 42;
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 
 void main() {
@@ -59,14 +59,14 @@
   }
 
   test_extension_outsideClassAndFile() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @protected
   void a(int i) {}
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 extension E on A {
   e() {
@@ -95,14 +95,14 @@
   }
 
   test_field_outsideClassAndLibrary() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @protected
   int a = 0;
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 abstract class B {
   int b() => new A().a;
@@ -128,14 +128,14 @@
   }
 
   test_fromSuperclassConstraint() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 abstract class A {
   @protected
   void foo() {}
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 mixin M on A {
   @override
@@ -150,14 +150,14 @@
   }
 
   test_function_outsideClassAndLibrary() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @protected
   void a(){ }
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 
 main() {
@@ -210,14 +210,14 @@
   }
 
   test_getter_outsideClassAndLibrary() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @protected
   int get a => 42;
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 class B {
   A a = A();
@@ -244,7 +244,7 @@
   }
 
   test_inDocs() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 
 class A {
@@ -258,7 +258,7 @@
   int a() => 0;
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 /// OK: [A.a], [A.b], [A.c].
 f() {}
@@ -269,14 +269,14 @@
   }
 
   test_method_outsideClassAndLibrary() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @protected
   void a() {}
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 
 class B {
@@ -355,14 +355,14 @@
     // TODO(srawlins): This test verifies that the analyzer **allows**
     // protected members to be called on objects other than `this`, which
     // violates the protected spec.
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @protected
   void set a(int i) { }
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 class B {
   A a = A();
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_overriding_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_overriding_member_test.dart
index 04c59dd..3b885ef 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_overriding_member_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_overriding_member_test.dart
@@ -23,7 +23,7 @@
   }
 
   test_differentLibrary_invalid() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 
 class Parent {
@@ -45,7 +45,7 @@
   }
 
   test_differentLibrary_valid_onlyOverride() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 
 class Parent {
@@ -65,7 +65,7 @@
   }
 
   test_differentLibrary_valid_overrideAndUse() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 
 class Parent {
@@ -89,7 +89,7 @@
   }
 
   test_getter() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 
 class A {
@@ -112,7 +112,7 @@
   }
 
   test_operator() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 
 class A {
@@ -133,7 +133,7 @@
   }
 
   test_overriding_getter() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 
 class A {
@@ -157,7 +157,7 @@
   }
 
   test_overriding_methodInvocation() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 
 class A {
@@ -181,7 +181,7 @@
   }
 
   test_overriding_operator() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 
 class A {
@@ -205,7 +205,7 @@
   }
 
   test_overriding_setter() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 
 class A {
@@ -246,7 +246,7 @@
   }
 
   test_setter() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'package:meta/meta.dart';
 
 class A {
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_template_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_template_member_test.dart
index a14ecc8..73a4149 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_template_member_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_template_member_test.dart
@@ -22,7 +22,7 @@
     super.setUp();
 
     var angularMetaPath = '/packages/angular_meta';
-    newFile2('$angularMetaPath/lib/angular_meta.dart', r'''
+    newFile('$angularMetaPath/lib/angular_meta.dart', r'''
 library angular.meta;
 
 const _VisibleForTemplate visibleForTemplate = const _VisibleForTemplate();
@@ -40,13 +40,13 @@
   }
 
   test_export() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 
 @visibleForTemplate
 int fn0() => 1;
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 export 'lib1.dart' show fn0;
 ''');
 
@@ -55,14 +55,14 @@
   }
 
   test_functionInExtension() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 extension E on List {
   @visibleForTemplate
   int m() => 1;
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 void main() {
   E([]).m();
@@ -76,14 +76,14 @@
   }
 
   test_functionInExtension_fromTemplate() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 extension E on List {
   @visibleForTemplate
   int m() => 1;
 }
 ''');
-    newFile2('$testPackageLibPath/lib1.template.dart', r'''
+    newFile('$testPackageLibPath/lib1.template.dart', r'''
 import 'lib1.dart';
 void main() {
   E([]).m();
@@ -95,14 +95,14 @@
   }
 
   test_method() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 class A {
   @visibleForTemplate
   void a(){ }
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 
 class B {
@@ -117,14 +117,14 @@
   }
 
   test_method_fromTemplate() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 class A {
   @visibleForTemplate
   void a(){ }
 }
 ''');
-    newFile2('$testPackageLibPath/lib1.template.dart', r'''
+    newFile('$testPackageLibPath/lib1.template.dart', r'''
 import 'lib1.dart';
 
 class B {
@@ -137,7 +137,7 @@
   }
 
   test_namedConstructor() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 class A {
   int _x;
@@ -146,7 +146,7 @@
   A.forTemplate(this._x);
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 
 void main() {
@@ -163,7 +163,7 @@
   }
 
   test_propertyAccess() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 class A {
   @visibleForTemplate
@@ -173,7 +173,7 @@
   set b(_) => 7;
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 
 void main() {
@@ -190,7 +190,7 @@
   }
 
   test_protectedAndForTemplate_usedAsProtected() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 import 'package:meta/meta.dart';
 class A {
@@ -199,7 +199,7 @@
   void a(){ }
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 class B extends A {
   void b() => new A().a();
@@ -211,7 +211,7 @@
   }
 
   test_protectedAndForTemplate_usedAsTemplate() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 import 'package:meta/meta.dart';
 class A {
@@ -220,7 +220,7 @@
   void a(){ }
 }
 ''');
-    newFile2('$testPackageLibPath/lib1.template.dart', r'''
+    newFile('$testPackageLibPath/lib1.template.dart', r'''
 import 'lib1.dart';
 void main() {
   new A().a();
@@ -232,13 +232,13 @@
   }
 
   test_topLevelFunction() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 
 @visibleForTemplate
 int fn0() => 1;
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 
 void main() {
@@ -253,12 +253,12 @@
   }
 
   test_topLevelVariable() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 @visibleForTemplate
 int a = 7;
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 
 void main() {
@@ -273,7 +273,7 @@
   }
 
   test_unnamedConstructor() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:angular_meta/angular_meta.dart';
 class A {
   int _x;
@@ -282,7 +282,7 @@
   A(this._x);
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 import 'lib1.dart';
 
 void main() {
diff --git a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_testing_member_test.dart b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_testing_member_test.dart
index c4ef484..2774121c 100644
--- a/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_testing_member_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/invalid_use_of_visible_for_testing_member_test.dart
@@ -26,7 +26,7 @@
   }
 
   test_export_hide() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:meta/meta.dart';
 
 @visibleForTesting
@@ -35,7 +35,7 @@
 class B {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 export 'a.dart' hide A;
 ''');
 
@@ -44,7 +44,7 @@
   }
 
   test_export_show() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:meta/meta.dart';
 
 @visibleForTesting
@@ -53,7 +53,7 @@
 class B {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 export 'a.dart' show A;
 ''');
 
@@ -62,14 +62,14 @@
   }
 
   test_fromIntegrationTestDirectory() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @visibleForTesting
   void a(){ }
 }
 ''');
-    newFile2('$testPackageRootPath/integration_test/test.dart', r'''
+    newFile('$testPackageRootPath/integration_test/test.dart', r'''
 import '../lib1.dart';
 class B {
   void b() => new A().a();
@@ -81,14 +81,14 @@
   }
 
   test_fromTestDirectory() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @visibleForTesting
   void a(){ }
 }
 ''');
-    newFile2('$testPackageRootPath/test/test.dart', r'''
+    newFile('$testPackageRootPath/test/test.dart', r'''
 import '../lib1.dart';
 class B {
   void b() => new A().a();
@@ -100,14 +100,14 @@
   }
 
   test_fromTestDriverDirectory() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @visibleForTesting
   void a(){ }
 }
 ''');
-    newFile2('$testPackageRootPath/test_driver/test.dart', r'''
+    newFile('$testPackageRootPath/test_driver/test.dart', r'''
 import '../lib1.dart';
 class B {
   void b() => new A().a();
@@ -119,14 +119,14 @@
   }
 
   test_fromTestingDirectory() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @visibleForTesting
   void a(){ }
 }
 ''');
-    newFile2('$testPackageRootPath/testing/lib1.dart', r'''
+    newFile('$testPackageRootPath/testing/lib1.dart', r'''
 import '../lib1.dart';
 class C {
   void b() => new A().a();
@@ -138,14 +138,14 @@
   }
 
   test_functionInExtension() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 extension E on List {
   @visibleForTesting
   int m() => 1;
 }
 ''');
-    newFile2('$testPackageRootPath/lib2.dart', r'''
+    newFile('$testPackageRootPath/lib2.dart', r'''
 import 'lib1.dart';
 void main() {
   E([]).m();
@@ -159,14 +159,14 @@
   }
 
   test_functionInExtension_fromTestDirectory() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 extension E on List {
   @visibleForTesting
   int m() => 1;
 }
 ''');
-    newFile2('$testPackageRootPath/test/test.dart', r'''
+    newFile('$testPackageRootPath/test/test.dart', r'''
 import '../lib1.dart';
 void main() {
   E([]).m();
@@ -178,14 +178,14 @@
   }
 
   test_getter() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @visibleForTesting
   int get a => 7;
 }
 ''');
-    newFile2('$testPackageRootPath/lib2.dart', r'''
+    newFile('$testPackageRootPath/lib2.dart', r'''
 import 'lib1.dart';
 void main() {
   new A().a;
@@ -199,7 +199,7 @@
   }
 
   test_import_hide() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:meta/meta.dart';
 
 @visibleForTesting
@@ -208,7 +208,7 @@
 class B {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 import 'a.dart' hide A;
 
 void f(B _) {}
@@ -219,7 +219,7 @@
   }
 
   test_import_show() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:meta/meta.dart';
 
 @visibleForTesting
@@ -228,7 +228,7 @@
 class B {}
 ''');
 
-    newFile2('$testPackageLibPath/b.dart', r'''
+    newFile('$testPackageLibPath/b.dart', r'''
 import 'a.dart' show A;
 
 void f(A _) {}
@@ -242,14 +242,14 @@
   }
 
   test_method() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @visibleForTesting
   void a(){ }
 }
 ''');
-    newFile2('$testPackageRootPath/lib2.dart', r'''
+    newFile('$testPackageRootPath/lib2.dart', r'''
 import 'lib1.dart';
 class B {
   void b() => new A().a();
@@ -263,7 +263,7 @@
   }
 
   test_mixin() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 mixin M {
   @visibleForTesting
@@ -271,7 +271,7 @@
 }
 class C with M {}
 ''');
-    newFile2('$testPackageRootPath/lib2.dart', r'''
+    newFile('$testPackageRootPath/lib2.dart', r'''
 import 'lib1.dart';
 void main() {
   C().m();
@@ -285,7 +285,7 @@
   }
 
   test_namedConstructor() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   int _x;
@@ -294,7 +294,7 @@
   A.forTesting(this._x);
 }
 ''');
-    newFile2('$testPackageRootPath/lib2.dart', r'''
+    newFile('$testPackageRootPath/lib2.dart', r'''
 import 'lib1.dart';
 void main() {
   new A.forTesting(0);
@@ -311,7 +311,7 @@
   }
 
   test_protectedAndForTesting_usedAsProtected() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @protected
@@ -319,7 +319,7 @@
   void a(){ }
 }
 ''');
-    newFile2('$testPackageRootPath/lib2.dart', r'''
+    newFile('$testPackageRootPath/lib2.dart', r'''
 import 'lib1.dart';
 class B extends A {
   void b() => new A().a();
@@ -331,7 +331,7 @@
   }
 
   test_protectedAndForTesting_usedAsTesting() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @protected
@@ -339,7 +339,7 @@
   void a(){ }
 }
 ''');
-    newFile2('$testPackageRootPath/test/test1.dart', r'''
+    newFile('$testPackageRootPath/test/test1.dart', r'''
 import '../lib1.dart';
 void main() {
   new A().a();
@@ -351,14 +351,14 @@
   }
 
   test_setter() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   @visibleForTesting
   set b(_) => 7;
 }
 ''');
-    newFile2('$testPackageRootPath/lib2.dart', r'''
+    newFile('$testPackageRootPath/lib2.dart', r'''
 import 'lib1.dart';
 void main() {
   new A().b = 6;
@@ -372,12 +372,12 @@
   }
 
   test_topLevelFunction() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 @visibleForTesting
 int fn0() => 1;
 ''');
-    newFile2('$testPackageRootPath/lib2.dart', r'''
+    newFile('$testPackageRootPath/lib2.dart', r'''
 import 'lib1.dart';
 void main() {
   fn0();
@@ -391,12 +391,12 @@
   }
 
   test_topLevelVariable() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 @visibleForTesting
 int a = 7;
 ''');
-    newFile2('$testPackageRootPath/lib2.dart', r'''
+    newFile('$testPackageRootPath/lib2.dart', r'''
 import 'lib1.dart';
 void main() {
   a;
@@ -410,7 +410,7 @@
   }
 
   test_unnamedConstructor() async {
-    newFile2('$testPackageRootPath/lib1.dart', r'''
+    newFile('$testPackageRootPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   int _x;
@@ -419,7 +419,7 @@
   A(this._x);
 }
 ''');
-    newFile2('$testPackageRootPath/lib2.dart', r'''
+    newFile('$testPackageRootPath/lib2.dart', r'''
 import 'lib1.dart';
 void main() {
   new A(0);
diff --git a/pkg/analyzer/test/src/diagnostics/missing_required_param_test.dart b/pkg/analyzer/test/src/diagnostics/missing_required_param_test.dart
index c6166de..e91a7a3 100644
--- a/pkg/analyzer/test/src/diagnostics/missing_required_param_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/missing_required_param_test.dart
@@ -18,7 +18,7 @@
 @reflectiveTest
 class MissingRequiredParamTest extends PubPackageResolutionTest {
   test_constructor_legacy_argumentGiven() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   A({required int a});
 }
@@ -34,7 +34,7 @@
   }
 
   test_constructor_legacy_missingArgument() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   A({required int a});
 }
@@ -162,7 +162,7 @@
   }
 
   test_function_legacy_argumentGiven() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void foo({required int a}) {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -176,7 +176,7 @@
   }
 
   test_function_legacy_missingArgument() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void foo({required int a}) {}
 ''');
     await assertErrorsInCode(r'''
@@ -216,7 +216,7 @@
   }
 
   test_method_inOtherLib() async {
-    newFile2('$testPackageLibPath/a_lib.dart', r'''
+    newFile('$testPackageLibPath/a_lib.dart', r'''
 class A {
   void m({required int a}) {}
 }
@@ -232,7 +232,7 @@
   }
 
   test_method_legacy_argumentGiven() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void foo({required int a}) {}
 }
@@ -248,7 +248,7 @@
   }
 
   test_method_legacy_missingArgument() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void foo({required int a}) {}
 }
@@ -454,13 +454,13 @@
   }
 
   test_method_inOtherLib() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:meta/meta.dart';
 class A {
   void m({@Required('must specify an `a`') int a}) {}
 }
 ''');
-    newFile2('$testPackageLibPath/test.dart', r'''
+    newFile('$testPackageLibPath/test.dart', r'''
 import 'a.dart';
 f() {
   new A().m();
diff --git a/pkg/analyzer/test/src/diagnostics/missing_return_test.dart b/pkg/analyzer/test/src/diagnostics/missing_return_test.dart
index be7dce8..bcc6ccde 100644
--- a/pkg/analyzer/test/src/diagnostics/missing_return_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/missing_return_test.dart
@@ -36,7 +36,7 @@
   }
 
   test_function_sync_block_Never() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 Never foo() {
   throw 0;
 }
diff --git a/pkg/analyzer/test/src/diagnostics/mixin_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_deferred_class_test.dart
index e45b0bc..059b5b6 100644
--- a/pkg/analyzer/test/src/diagnostics/mixin_deferred_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/mixin_deferred_class_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class MixinDeferredClassTest extends PubPackageResolutionTest {
   test_classTypeAlias() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}
 ''');
@@ -31,7 +31,7 @@
   }
 
   test_enum() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {}
 ''');
     await assertErrorsInCode('''
@@ -45,7 +45,7 @@
   }
 
   test_mixin_deferred_class() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/mixin_inference_no_possible_substitution_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_inference_no_possible_substitution_test.dart
index d2fd8ed..3b2bdfa 100644
--- a/pkg/analyzer/test/src/diagnostics/mixin_inference_no_possible_substitution_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/mixin_inference_no_possible_substitution_test.dart
@@ -22,7 +22,7 @@
 class MixinInferenceNoPossibleSubstitutionTest extends PubPackageResolutionTest
     with MixinInferenceNoPossibleSubstitutionTestCases {
   test_valid_nonNullableMixins_legacyApplication() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {}
 
 mixin B<T> on A<T> {}
diff --git a/pkg/analyzer/test/src/diagnostics/mixin_of_non_class_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_of_non_class_test.dart
index 20036a2..a74248a 100644
--- a/pkg/analyzer/test/src/diagnostics/mixin_of_non_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/mixin_of_non_class_test.dart
@@ -125,7 +125,7 @@
   }
 
   test_undefined_ignore_part_exists_uriGenerated_nameIgnorable() async {
-    newFile2('$testPackageLibPath/a.g.dart', r'''
+    newFile('$testPackageLibPath/a.g.dart', r'''
 part of 'test.dart';
 ''');
 
diff --git a/pkg/analyzer/test/src/diagnostics/mixin_on_sealed_class_test.dart b/pkg/analyzer/test/src/diagnostics/mixin_on_sealed_class_test.dart
index e03b2cd..0cc1304 100644
--- a/pkg/analyzer/test/src/diagnostics/mixin_on_sealed_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/mixin_on_sealed_class_test.dart
@@ -28,7 +28,7 @@
       meta: true,
     );
 
-    newFile2('$workspaceRootPath/foo/lib/foo.dart', r'''
+    newFile('$workspaceRootPath/foo/lib/foo.dart', r'''
 import 'package:meta/meta.dart';
 @sealed class Foo {}
 ''');
@@ -50,12 +50,12 @@
   }
 
   test_withinPackageLibDirectory_OK() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 @sealed class Foo {}
 ''');
 
-    newFile2('$testPackageLibPath/src/lib2.dart', r'''
+    newFile('$testPackageLibPath/src/lib2.dart', r'''
 import '../lib1.dart';
 mixin Bar on Foo {}
 ''');
@@ -68,12 +68,12 @@
   }
 
   test_withinPackageTestDirectory_OK() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 @sealed class Foo {}
 ''');
 
-    newFile2('$testPackageRootPath/test/lib2.dart', r'''
+    newFile('$testPackageRootPath/test/lib2.dart', r'''
 import 'package:test/lib1.dart';
 mixin Bar on Foo {}
 ''');
@@ -86,13 +86,13 @@
   }
 
   test_withinPart_OK() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 import 'package:meta/meta.dart';
 part 'part1.dart';
 @sealed class Foo {}
 ''');
 
-    newFile2('$testPackageLibPath/part1.dart', r'''
+    newFile('$testPackageLibPath/part1.dart', r'''
 part of 'lib1.dart';
 mixin Bar on Foo {}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/new_with_non_type_test.dart b/pkg/analyzer/test/src/diagnostics/new_with_non_type_test.dart
index 9fccc5a..18d9654 100644
--- a/pkg/analyzer/test/src/diagnostics/new_with_non_type_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/new_with_non_type_test.dart
@@ -28,7 +28,7 @@
   }
 
   test_imported() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class B {}
 ''');
     await assertErrorsInCode('''
diff --git a/pkg/analyzer/test/src/diagnostics/new_with_undefined_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/new_with_undefined_constructor_test.dart
index e059e0f..46ea3fb 100644
--- a/pkg/analyzer/test/src/diagnostics/new_with_undefined_constructor_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/new_with_undefined_constructor_test.dart
@@ -49,7 +49,7 @@
   }
 
   test_default_prefixed() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class A {
   A.name() {}
 }
@@ -127,7 +127,7 @@
   }
 
   test_named_prefixed() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class A {
   A() {}
 }
@@ -144,7 +144,7 @@
   }
 
   test_private_named() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   A._named() {}
 }
@@ -160,7 +160,7 @@
   }
 
   test_private_named_genericClass_noTypeArguments() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   A._named() {}
 }
@@ -176,7 +176,7 @@
   }
 
   test_private_named_genericClass_withTypeArguments() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   A._named() {}
 }
diff --git a/pkg/analyzer/test/src/diagnostics/no_default_super_constructor_test.dart b/pkg/analyzer/test/src/diagnostics/no_default_super_constructor_test.dart
index 7a8ae3f..800c284 100644
--- a/pkg/analyzer/test/src/diagnostics/no_default_super_constructor_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/no_default_super_constructor_test.dart
@@ -80,7 +80,7 @@
   }
 
   test_super_requiredNamed_legacySubclass_explicitConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   A({required String s});
 }
@@ -96,7 +96,7 @@
   }
 
   test_super_requiredNamed_legacySubclass_implicitConstructor() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   A({required String s});
 }O
diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_from_deferred_library_test.dart
index be174947..50e1b50 100644
--- a/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_from_deferred_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/non_constant_case_expression_from_deferred_library_test.dart
@@ -17,7 +17,7 @@
 class NonConstantCaseExpressionFromDeferredLibraryTest
     extends PubPackageResolutionTest {
   test_nested() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 const int c = 0;
 ''');
 
@@ -40,7 +40,7 @@
   }
 
   test_simple() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 const int c = 0;
 ''');
 
diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_default_value_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_default_value_from_deferred_library_test.dart
index e0c8d12..127ba46 100644
--- a/pkg/analyzer/test/src/diagnostics/non_constant_default_value_from_deferred_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/non_constant_default_value_from_deferred_library_test.dart
@@ -17,7 +17,7 @@
 class NonConstantDefaultValueFromDeferredLibraryTest
     extends PubPackageResolutionTest {
   test_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 const V = 1;
 ''');
@@ -34,7 +34,7 @@
   }
 
   test_nested() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 const V = 1;
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart
index 66cd709..5398b86 100644
--- a/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/non_constant_default_value_test.dart
@@ -62,7 +62,7 @@
   }
 
   test_constructor_inDifferentFile() async {
-    newFile2('/test/lib/a.dart', '''
+    newFile('/test/lib/a.dart', '''
 import 'b.dart';
 const v = const MyClass();
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_list_element_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_list_element_from_deferred_library_test.dart
index 304ab6d..7ef1145 100644
--- a/pkg/analyzer/test/src/diagnostics/non_constant_list_element_from_deferred_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/non_constant_list_element_from_deferred_library_test.dart
@@ -23,7 +23,7 @@
   @failingTest
   test_const_ifElement_thenTrue_deferredElse() async {
     // reports wrong error code (which is not crucial to fix)
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -38,7 +38,7 @@
   }
 
   test_const_ifElement_thenTrue_deferredThen() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -53,7 +53,7 @@
   }
 
   test_const_topLevel_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -67,7 +67,7 @@
   }
 
   test_const_topLevel_deferred_nested() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_map_key_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_map_key_from_deferred_library_test.dart
index 0ca45d8..f12929b 100644
--- a/pkg/analyzer/test/src/diagnostics/non_constant_map_key_from_deferred_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/non_constant_map_key_from_deferred_library_test.dart
@@ -22,7 +22,7 @@
   @failingTest
   test_const_ifElement_thenTrue_deferredElse() async {
 // reports wrong error code
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -35,7 +35,7 @@
   }
 
   test_const_ifElement_thenTrue_deferredThen() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -48,7 +48,7 @@
   }
 
   test_const_topLevel_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -60,7 +60,7 @@
   }
 
   test_const_topLevel_deferred_nested() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
diff --git a/pkg/analyzer/test/src/diagnostics/non_constant_map_value_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/non_constant_map_value_from_deferred_library_test.dart
index 5cc04b3..47025d3 100644
--- a/pkg/analyzer/test/src/diagnostics/non_constant_map_value_from_deferred_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/non_constant_map_value_from_deferred_library_test.dart
@@ -23,7 +23,7 @@
   @failingTest
   test_const_ifElement_thenTrue_elseDeferred() async {
     // reports wrong error code
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -36,7 +36,7 @@
   }
 
   test_const_ifElement_thenTrue_thenDeferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -49,7 +49,7 @@
   }
 
   test_const_topLevel_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -61,7 +61,7 @@
   }
 
   test_const_topLevel_deferred_nested() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
diff --git a/pkg/analyzer/test/src/diagnostics/non_null_opt_out_test.dart b/pkg/analyzer/test/src/diagnostics/non_null_opt_out_test.dart
index 3bc5532..52f42c8 100644
--- a/pkg/analyzer/test/src/diagnostics/non_null_opt_out_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/non_null_opt_out_test.dart
@@ -24,7 +24,7 @@
   }
 
   test_assignment_indexExpression() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void operator[]=(int a, int b) {}
 }
@@ -53,7 +53,7 @@
   }
 
   test_assignment_prefixedIdentifier_instanceTarget_class_field() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo = 0;
 }
@@ -81,7 +81,7 @@
   }
 
   test_assignment_prefixedIdentifier_instanceTarget_extension_setter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 extension E on A {
   void set foo(int _) {}
@@ -110,7 +110,7 @@
   }
 
   test_assignment_prefixedIdentifier_staticTarget_class_field() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static int foo = 0;
 }
@@ -138,7 +138,7 @@
   }
 
   test_assignment_prefixedIdentifier_staticTarget_extension_field() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E on int {
   static int foo = 0;
 }
@@ -166,7 +166,7 @@
   }
 
   test_assignment_prefixedIdentifier_topLevelVariable() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int foo = 0;
 ''');
     await assertNoErrorsInCode(r'''
@@ -192,7 +192,7 @@
   }
 
   test_assignment_propertyAccess_class_field() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo = 0;
 }
@@ -220,7 +220,7 @@
   }
 
   test_assignment_propertyAccess_extension_setter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 extension E on A {
   void set foo(int a) {}
@@ -249,7 +249,7 @@
   }
 
   test_assignment_propertyAccess_extensionOverride_setter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 extension E on A {
   void set foo(int a) {}
@@ -278,7 +278,7 @@
   }
 
   test_assignment_propertyAccess_superTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo = 0;
 }
@@ -308,7 +308,7 @@
   }
 
   test_assignment_simpleIdentifier_topLevelVariable() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int foo = 0;
 ''');
     await assertNoErrorsInCode(r'''
@@ -334,7 +334,7 @@
   }
 
   test_binaryExpression() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int operator+(int a) => 0;
 }
@@ -356,7 +356,7 @@
   }
 
   test_functionExpressionInvocation() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int Function(int, int?)? foo;
 ''');
     await assertNoErrorsInCode(r'''
@@ -379,7 +379,7 @@
   }
 
   test_functionExpressionInvocation_call() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int call(int a, int? b) => 0;
 }
@@ -404,7 +404,7 @@
   }
 
   test_functionExpressionInvocation_extension_staticTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E on int {
   static int Function(int) get foo => (_) => 0;
 }
@@ -429,7 +429,7 @@
   }
 
   test_instanceCreation() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   A(int a, int? b);
 }
@@ -452,7 +452,7 @@
   }
 
   test_instanceCreation_generic() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T> {
   A(T a, T? b);
 }
@@ -476,7 +476,7 @@
   }
 
   test_instanceCreation_generic_instantiateToBounds() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<T extends num> {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -491,7 +491,7 @@
   }
 
   test_methodInvocation_extension_functionTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E on void Function() {
   int foo(int a) => 0;
 }
@@ -516,7 +516,7 @@
   }
 
   test_methodInvocation_extension_interfaceTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E on int {
   int foo(int a) => 0;
 }
@@ -541,7 +541,7 @@
   }
 
   test_methodInvocation_extension_nullTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 extension E on A {
   int foo(int a) => 0;
@@ -569,7 +569,7 @@
   }
 
   test_methodInvocation_extension_staticTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E on int {
   static int foo(int a) => 0;
 }
@@ -594,7 +594,7 @@
   }
 
   test_methodInvocation_extensionOverride() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E on int {
   int foo(int a) => 0;
 }
@@ -619,7 +619,7 @@
   }
 
   test_methodInvocation_function() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int foo(int a, int? b) => 0;
 ''');
     await assertNoErrorsInCode(r'''
@@ -642,7 +642,7 @@
   }
 
   test_methodInvocation_function_prefixed() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int foo(int a, int? b) => 0;
 ''');
     await assertNoErrorsInCode(r'''
@@ -665,7 +665,7 @@
   }
 
   test_methodInvocation_method_cascade() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo(int a, int? b) => 0;
 }
@@ -690,7 +690,7 @@
   }
 
   test_methodInvocation_method_interfaceTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo(int a, int? b) => 0;
 }
@@ -715,7 +715,7 @@
   }
 
   test_methodInvocation_method_nullTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo(int a, int? b) => 0;
 }
@@ -742,7 +742,7 @@
   }
 
   test_methodInvocation_method_staticTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static int foo(int a, int? b) => 0;
 }
@@ -767,7 +767,7 @@
   }
 
   test_methodInvocation_method_superTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo(int a, int? b) => 0;
 }
@@ -821,7 +821,7 @@
   }
 
   test_postfixExpression() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   A operator+(int a) => this;
 }
@@ -842,7 +842,7 @@
   }
 
   test_prefixExpression() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int operator-() => 0;
 }
@@ -863,7 +863,7 @@
   }
 
   test_read_indexExpression_class() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int operator[](int a) => 0;
 }
@@ -884,7 +884,7 @@
   }
 
   test_read_prefixedIdentifier_instanceTarget_class_field() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo;
 }
@@ -908,7 +908,7 @@
   }
 
   test_read_prefixedIdentifier_instanceTarget_extension_getter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 extension E on A {
   int get foo => 0;
@@ -933,7 +933,7 @@
   }
 
   test_read_prefixedIdentifier_staticTarget_class_field() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static int foo;
 }
@@ -957,7 +957,7 @@
   }
 
   test_read_prefixedIdentifier_staticTarget_class_method() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static int foo(int a) => 0;
 }
@@ -981,7 +981,7 @@
   }
 
   test_read_prefixedIdentifier_staticTarget_extension_field() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E {
   static int foo;
 }
@@ -1005,7 +1005,7 @@
   }
 
   test_read_prefixedIdentifier_staticTarget_extension_method() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E {
   static int foo(int a) => 0;
 }
@@ -1029,7 +1029,7 @@
   }
 
   test_read_prefixedIdentifier_topLevelVariable() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int foo = 0;
 ''');
     await assertNoErrorsInCode(r'''
@@ -1051,7 +1051,7 @@
   }
 
   test_read_propertyAccessor_class_field() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo = 0;
 }
@@ -1075,7 +1075,7 @@
   }
 
   test_read_propertyAccessor_class_method() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo() => 0;
 }
@@ -1099,7 +1099,7 @@
   }
 
   test_read_propertyAccessor_extensionOverride_getter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 extension E on A {
   int get foo => 0;
@@ -1124,7 +1124,7 @@
   }
 
   test_read_propertyAccessor_superTarget() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo = 0;
 }
@@ -1150,7 +1150,7 @@
   }
 
   test_read_simpleIdentifier_class_field() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo = 0;
 }
@@ -1173,7 +1173,7 @@
   }
 
   test_read_simpleIdentifier_class_method() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int foo(int a) => 0;
 }
@@ -1196,7 +1196,7 @@
   }
 
   test_read_simpleIdentifier_extension_getter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 extension E on A {
   int get foo => 0;
@@ -1220,7 +1220,7 @@
   }
 
   test_read_simpleIdentifier_extension_method() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {}
 extension E on A {
   int foo(int a) => 0;
@@ -1244,7 +1244,7 @@
   }
 
   test_read_simpleIdentifier_topLevelVariable() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int foo = 0;
 ''');
     await assertNoErrorsInCode(r'''
@@ -1263,7 +1263,7 @@
   }
 
   test_superConstructorInvocation() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   A(int a, int? b);
 }
diff --git a/pkg/analyzer/test/src/diagnostics/part_of_different_library_test.dart b/pkg/analyzer/test/src/diagnostics/part_of_different_library_test.dart
index 2aa3af9..f90d50b 100644
--- a/pkg/analyzer/test/src/diagnostics/part_of_different_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/part_of_different_library_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class PartOfDifferentLibraryTest extends PubPackageResolutionTest {
   test_name() async {
-    newFile2('$testPackageLibPath/part.dart', "part of lub;");
+    newFile('$testPackageLibPath/part.dart', "part of lub;");
     await assertErrorsInCode('''
 library lib;
 part 'part.dart';
diff --git a/pkg/analyzer/test/src/diagnostics/part_of_non_part_test.dart b/pkg/analyzer/test/src/diagnostics/part_of_non_part_test.dart
index 9f69cdc..ae49353 100644
--- a/pkg/analyzer/test/src/diagnostics/part_of_non_part_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/part_of_non_part_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class PartOfNonPartTest extends PubPackageResolutionTest {
   test_part_of_non_part() async {
-    newFile2('$testPackageLibPath/l2.dart', '''
+    newFile('$testPackageLibPath/l2.dart', '''
 library l2;
 ''');
     await assertErrorsInCode(r'''
diff --git a/pkg/analyzer/test/src/diagnostics/prefix_collides_with_top_level_member_test.dart b/pkg/analyzer/test/src/diagnostics/prefix_collides_with_top_level_member_test.dart
index 855cc07..1050310 100644
--- a/pkg/analyzer/test/src/diagnostics/prefix_collides_with_top_level_member_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/prefix_collides_with_top_level_member_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class PrefixCollidesWithTopLevelMemberTest extends PubPackageResolutionTest {
   test_functionTypeAlias() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 library lib;
 class A{}
 ''');
@@ -30,7 +30,7 @@
   }
 
   test_no_collision() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 library lib;
 class A {}''');
     await assertNoErrorsInCode(r'''
@@ -44,7 +44,7 @@
   }
 
   test_topLevelFunction() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 library lib;
 class A{}
 ''');
@@ -58,7 +58,7 @@
   }
 
   test_topLevelVariable() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 library lib;
 class A{}
 ''');
@@ -72,7 +72,7 @@
   }
 
   test_type() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 library lib;
 class A{}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/prefix_identifier_not_followed_by_dot_test.dart b/pkg/analyzer/test/src/diagnostics/prefix_identifier_not_followed_by_dot_test.dart
index 3ae3ccc..9b96efa 100644
--- a/pkg/analyzer/test/src/diagnostics/prefix_identifier_not_followed_by_dot_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/prefix_identifier_not_followed_by_dot_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class PrefixIdentifierNotFollowedByDotTest extends PubPackageResolutionTest {
   test_assignment_compound_in_method() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await assertErrorsInCode('''
@@ -32,7 +32,7 @@
   }
 
   test_assignment_compound_not_in_method() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await assertErrorsInCode('''
@@ -46,7 +46,7 @@
   }
 
   test_assignment_in_method() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await assertErrorsInCode('''
@@ -81,7 +81,7 @@
   }
 
   test_assignment_not_in_method() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await assertErrorsInCode('''
@@ -95,7 +95,7 @@
   }
 
   test_compoundAssignment() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await assertErrorsInCode('''
@@ -109,7 +109,7 @@
   }
 
   test_conditionalMethodInvocation() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 g() {}
 ''');
@@ -124,7 +124,7 @@
   }
 
   test_conditionalPropertyAccess_call_loadLibrary() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await assertErrorsInCode('''
@@ -139,7 +139,7 @@
   }
 
   test_conditionalPropertyAccess_get() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 var x;
 ''');
@@ -154,7 +154,7 @@
   }
 
   test_conditionalPropertyAccess_get_loadLibrary() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await assertErrorsInCode('''
@@ -168,7 +168,7 @@
   }
 
   test_conditionalPropertyAccess_set() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 var x;
 ''');
@@ -183,7 +183,7 @@
   }
 
   test_conditionalPropertyAccess_set_loadLibrary() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await assertErrorsInCode('''
@@ -197,7 +197,7 @@
   }
 
   test_prefix_not_followed_by_dot() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 ''');
     await assertErrorsInCode('''
diff --git a/pkg/analyzer/test/src/diagnostics/private_collision_in_mixin_application_test.dart b/pkg/analyzer/test/src/diagnostics/private_collision_in_mixin_application_test.dart
index 53a4ceb..0ef5f33 100644
--- a/pkg/analyzer/test/src/diagnostics/private_collision_in_mixin_application_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/private_collision_in_mixin_application_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class PrivateCollisionInMixinApplicationTest extends PubPackageResolutionTest {
   test_class_interfaceAndMixin_same() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo() {}
 }
@@ -31,7 +31,7 @@
   }
 
   test_class_mixinAndMixin() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo() {}
 }
@@ -51,7 +51,7 @@
   }
 
   test_class_mixinAndMixin_indirect() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo() {}
 }
@@ -72,7 +72,7 @@
   }
 
   test_class_mixinAndMixin_withoutExtends() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo() {}
 }
@@ -92,7 +92,7 @@
   }
 
   test_class_staticAndInstanceElement() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static void _foo() {}
 }
@@ -110,7 +110,7 @@
   }
 
   test_class_staticElements() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static void _foo() {}
 }
@@ -128,7 +128,7 @@
   }
 
   test_class_superclassAndMixin_getter2() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   int get _foo => 0;
 }
@@ -148,7 +148,7 @@
   }
 
   test_class_superclassAndMixin_method2() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo() {}
 }
@@ -185,7 +185,7 @@
   }
 
   test_class_superclassAndMixin_setter2() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   set _foo(int _) {}
 }
@@ -205,7 +205,7 @@
   }
 
   test_classTypeAlias_mixinAndMixin() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo() {}
 }
@@ -225,7 +225,7 @@
   }
 
   test_classTypeAlias_mixinAndMixin_indirect() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo() {}
 }
@@ -246,7 +246,7 @@
   }
 
   test_classTypeAlias_superclassAndMixin() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void _foo() {}
 }
@@ -266,7 +266,7 @@
   }
 
   test_enum_getter_mixinAndMixin() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 mixin A {
   int get _foo => 0;
 }
@@ -288,7 +288,7 @@
   }
 
   test_enum_method_interfaceAndMixin_same() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 mixin A {
   void _foo() {}
 }
@@ -305,7 +305,7 @@
   }
 
   test_enum_method_mixinAndMixin() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 mixin A {
   void _foo() {}
 }
@@ -327,7 +327,7 @@
   }
 
   test_enum_method_staticAndInstanceElement() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 mixin A {
   static void _foo() {}
 }
@@ -347,7 +347,7 @@
   }
 
   test_enum_setter_mixinAndMixin() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 mixin A {
   set _foo(int _) {}
 }
diff --git a/pkg/analyzer/test/src/diagnostics/private_setter_test.dart b/pkg/analyzer/test/src/diagnostics/private_setter_test.dart
index 1ab1e89..37cce24 100644
--- a/pkg/analyzer/test/src/diagnostics/private_setter_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/private_setter_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class PrivateSetterTest extends PubPackageResolutionTest {
   test_typeLiteral_privateField_differentLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static int _foo = 0;
 }
@@ -58,7 +58,7 @@
   }
 
   test_typeLiteral_privateSetter_differentLibrary_hasGetter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static set _foo(int _) {}
 
@@ -89,7 +89,7 @@
   }
 
   test_typeLiteral_privateSetter_differentLibrary_noGetter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   static set _foo(int _) {}
 }
diff --git a/pkg/analyzer/test/src/diagnostics/recursive_compile_time_constant_test.dart b/pkg/analyzer/test/src/diagnostics/recursive_compile_time_constant_test.dart
index 6ce6a7e..6bb0953 100644
--- a/pkg/analyzer/test/src/diagnostics/recursive_compile_time_constant_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/recursive_compile_time_constant_test.dart
@@ -73,7 +73,7 @@
   }
 
   test_fromMapLiteral() async {
-    newFile2(
+    newFile(
       '$testPackageLibPath/constants.dart',
       r'''
 const int x = y;
diff --git a/pkg/analyzer/test/src/diagnostics/sdk_version_async_exported_from_core_test.dart b/pkg/analyzer/test/src/diagnostics/sdk_version_async_exported_from_core_test.dart
index aa0b7e5..90054d2 100644
--- a/pkg/analyzer/test/src/diagnostics/sdk_version_async_exported_from_core_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/sdk_version_async_exported_from_core_test.dart
@@ -32,7 +32,7 @@
   }
 
   test_equals_explicitImportOfExportingLibrary() async {
-    newFile2('$testPackageLibPath/exporter.dart', '''
+    newFile('$testPackageLibPath/exporter.dart', '''
 export 'dart:async';
 ''');
     await verifyVersion('2.1.0', '''
@@ -49,7 +49,7 @@
   }
 
   test_equals_implicitImportOfCore_inPart() async {
-    newFile2('/lib.dart', '''
+    newFile('/lib.dart', '''
 library lib;
 ''');
     await verifyVersion('2.1.0', '''
@@ -78,7 +78,7 @@
   }
 
   test_lessThan_explicitImportOfExportingLibrary() async {
-    newFile2('$testPackageLibPath/exporter.dart', '''
+    newFile('$testPackageLibPath/exporter.dart', '''
 export 'dart:async';
 ''');
     await verifyVersion('2.0.0', '''
@@ -97,7 +97,7 @@
   }
 
   test_lessThan_implicitImportOfCore_inPart() async {
-    newFile2('/lib.dart', '''
+    newFile('/lib.dart', '''
 library lib;
 ''');
     await verifyVersion('2.0.0', '''
diff --git a/pkg/analyzer/test/src/diagnostics/set_element_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/set_element_from_deferred_library_test.dart
index 3aade1c..b0afe54 100644
--- a/pkg/analyzer/test/src/diagnostics/set_element_from_deferred_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/set_element_from_deferred_library_test.dart
@@ -21,7 +21,7 @@
   @failingTest
   test_const_ifElement_thenTrue_elseDeferred() async {
     // reports wrong error code
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -33,7 +33,7 @@
   }
 
   test_const_ifElement_thenTrue_thenDeferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -45,7 +45,7 @@
   }
 
   test_const_topLevel_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -56,7 +56,7 @@
   }
 
   test_const_topLevel_deferred_nested() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int c = 1;''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
diff --git a/pkg/analyzer/test/src/diagnostics/shared_deferred_prefix_test.dart b/pkg/analyzer/test/src/diagnostics/shared_deferred_prefix_test.dart
index fbf12c2..6a7031e 100644
--- a/pkg/analyzer/test/src/diagnostics/shared_deferred_prefix_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/shared_deferred_prefix_test.dart
@@ -16,11 +16,11 @@
 @reflectiveTest
 class SharedDeferredPrefixTest extends PubPackageResolutionTest {
   test_hasSharedDeferredPrefix() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 f1() {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', '''
+    newFile('$testPackageLibPath/lib2.dart', '''
 library lib2;
 f2() {}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/spread_expression_from_deferred_library_test.dart b/pkg/analyzer/test/src/diagnostics/spread_expression_from_deferred_library_test.dart
index 69b8519..557e1bd 100644
--- a/pkg/analyzer/test/src/diagnostics/spread_expression_from_deferred_library_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/spread_expression_from_deferred_library_test.dart
@@ -19,7 +19,7 @@
 
 mixin SpreadExpressionFromDeferredLibraryTestCases on PubPackageResolutionTest {
   test_inList_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const List c = [];''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -32,7 +32,7 @@
   }
 
   test_inList_deferred_notConst() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const List c = [];''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -42,7 +42,7 @@
   }
 
   test_inList_notDeferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const List c = [];''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' as a;
@@ -52,7 +52,7 @@
   }
 
   test_inMap_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const Map c = <int, int>{};''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -65,7 +65,7 @@
   }
 
   test_inMap_notConst() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const Map c = <int, int>{};''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -75,7 +75,7 @@
   }
 
   test_inMap_notDeferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const Map c = <int, int>{};''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' as a;
@@ -85,7 +85,7 @@
   }
 
   test_inSet_deferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const Set c = <int>{};''');
     await assertErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -98,7 +98,7 @@
   }
 
   test_inSet_notConst() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const Set c = <int>{};''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' deferred as a;
@@ -108,7 +108,7 @@
   }
 
   test_inSet_notDeferred() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const Set c = <int>{};''');
     await assertNoErrorsInCode(r'''
 import 'lib1.dart' as a;
diff --git a/pkg/analyzer/test/src/diagnostics/subtype_of_sealed_class_test.dart b/pkg/analyzer/test/src/diagnostics/subtype_of_sealed_class_test.dart
index c58a45c..686293c 100644
--- a/pkg/analyzer/test/src/diagnostics/subtype_of_sealed_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/subtype_of_sealed_class_test.dart
@@ -28,7 +28,7 @@
       meta: true,
     );
 
-    newFile2('$workspaceRootPath/foo/lib/foo.dart', r'''
+    newFile('$workspaceRootPath/foo/lib/foo.dart', r'''
 import 'package:meta/meta.dart';
 @sealed class Foo {}
 ''');
@@ -48,7 +48,7 @@
       meta: true,
     );
 
-    newFile2('$workspaceRootPath/foo/lib/foo.dart', r'''
+    newFile('$workspaceRootPath/foo/lib/foo.dart', r'''
 import 'package:meta/meta.dart';
 @sealed class Foo {}
 ''');
@@ -68,7 +68,7 @@
       meta: true,
     );
 
-    newFile2('$workspaceRootPath/foo/lib/foo.dart', r'''
+    newFile('$workspaceRootPath/foo/lib/foo.dart', r'''
 import 'package:meta/meta.dart';
 @sealed class Foo {}
 ''');
@@ -89,7 +89,7 @@
       meta: true,
     );
 
-    newFile2('$workspaceRootPath/foo/lib/foo.dart', r'''
+    newFile('$workspaceRootPath/foo/lib/foo.dart', r'''
 import 'package:meta/meta.dart';
 @sealed mixin Foo {}
 ''');
@@ -110,7 +110,7 @@
       meta: true,
     );
 
-    newFile2('$workspaceRootPath/foo/lib/foo.dart', r'''
+    newFile('$workspaceRootPath/foo/lib/foo.dart', r'''
 import 'package:meta/meta.dart';
 @sealed mixin Foo {}
 ''');
@@ -130,7 +130,7 @@
       meta: true,
     );
 
-    newFile2('$workspaceRootPath/foo/lib/foo.dart', r'''
+    newFile('$workspaceRootPath/foo/lib/foo.dart', r'''
 import 'package:meta/meta.dart';
 @sealed class Foo {}
 ''');
@@ -156,7 +156,7 @@
   }
 
   test_withinPackageLibDirectory_OK() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:meta/meta.dart';
 @sealed class Foo {}
 ''');
@@ -172,7 +172,7 @@
   }
 
   test_withinPackageTestDirectory_OK() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'package:meta/meta.dart';
 @sealed class Foo {}
 ''');
@@ -192,13 +192,13 @@
     var libPath = '$testPackageLibPath/a.dart';
     var partPath = '$testPackageLibPath/b.dart';
 
-    newFile2(libPath, r'''
+    newFile(libPath, r'''
 import 'package:meta/meta.dart';
 part 'b.dart';
 @sealed class Foo {}
 ''');
 
-    newFile2(partPath, r'''
+    newFile(partPath, r'''
 part of 'a.dart';
 class Bar1 extends Foo {}
 class Bar2 implements Foo {}
diff --git a/pkg/analyzer/test/src/diagnostics/subtype_of_struct_class_test.dart b/pkg/analyzer/test/src/diagnostics/subtype_of_struct_class_test.dart
index e48f5fe..f459798 100644
--- a/pkg/analyzer/test/src/diagnostics/subtype_of_struct_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/subtype_of_struct_class_test.dart
@@ -75,7 +75,7 @@
   }
 
   test_implements_struct_prefixed() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 import 'dart:ffi';
 class S extends Struct {}
 ''');
@@ -116,7 +116,7 @@
   }
 
   test_with_struct_prefixed() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 import 'dart:ffi';
 class S extends Struct {}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/throw_of_invalid_type_test.dart b/pkg/analyzer/test/src/diagnostics/throw_of_invalid_type_test.dart
index 6acba98..c45d728 100644
--- a/pkg/analyzer/test/src/diagnostics/throw_of_invalid_type_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/throw_of_invalid_type_test.dart
@@ -24,7 +24,7 @@
   }
 
   test_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 int a = 0;
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/top_level_instance_getter_test.dart b/pkg/analyzer/test/src/diagnostics/top_level_instance_getter_test.dart
index 93c3e4e..b38600b 100644
--- a/pkg/analyzer/test/src/diagnostics/top_level_instance_getter_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/top_level_instance_getter_test.dart
@@ -47,7 +47,7 @@
   }
 
   test_field_imported() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A {
   int f = 0;
 }
@@ -293,7 +293,7 @@
   }
 
   test_implicitlyTyped_new_explicit_type_params_prefixed() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class B<T> {
   B(x);
 }
@@ -352,7 +352,7 @@
   }
 
   test_implicitlyTyped_new_not_generic_prefixed() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class B {
   B(x);
 }
@@ -369,7 +369,7 @@
   }
 
   test_implicitlyTyped_new_prefixed() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class B<T> {
   B(T x);
 }
diff --git a/pkg/analyzer/test/src/diagnostics/type_annotation_deferred_class_test.dart b/pkg/analyzer/test/src/diagnostics/type_annotation_deferred_class_test.dart
index d46f4ea..d3afa27 100644
--- a/pkg/analyzer/test/src/diagnostics/type_annotation_deferred_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/type_annotation_deferred_class_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class TypeAnnotationDeferredClassTest extends PubPackageResolutionTest {
   test_annotation_typeArgument() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class D {}
 ''');
     await assertErrorsInCode('''
@@ -31,7 +31,7 @@
   }
 
   test_asExpression() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -45,7 +45,7 @@
   }
 
   test_catchClause() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -61,7 +61,7 @@
   }
 
   test_fieldFormalParameter() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -76,7 +76,7 @@
   }
 
   test_functionDeclaration_returnType() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -89,7 +89,7 @@
   }
 
   test_functionTypedFormalParameter_returnType() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -101,7 +101,7 @@
   }
 
   test_isExpression() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -116,7 +116,7 @@
   }
 
   test_methodDeclaration_returnType() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -130,7 +130,7 @@
   }
 
   test_simpleFormalParameter() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -142,7 +142,7 @@
   }
 
   test_typeArgumentList() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -156,7 +156,7 @@
   }
 
   test_typeArgumentList2() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -171,7 +171,7 @@
   }
 
   test_typeParameter_bound() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
@@ -183,7 +183,7 @@
   }
 
   test_variableDeclarationList() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 library lib1;
 class A {}''');
     await assertErrorsInCode('''
diff --git a/pkg/analyzer/test/src/diagnostics/type_argument_not_matching_bounds_test.dart b/pkg/analyzer/test/src/diagnostics/type_argument_not_matching_bounds_test.dart
index 3f52554..134478d 100644
--- a/pkg/analyzer/test/src/diagnostics/type_argument_not_matching_bounds_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/type_argument_not_matching_bounds_test.dart
@@ -49,7 +49,7 @@
   }
 
   test_extends_optIn_fromOptOut_Null() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<X extends int> {}
 ''');
 
@@ -62,7 +62,7 @@
   }
 
   test_extends_optIn_fromOptOut_otherTypeParameter() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void foo<T extends U, U>() {
 }
 ''');
@@ -81,7 +81,7 @@
   }
 
   test_extensionOverride_optIn_fromOptOut_Null() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 extension E<X extends int> on List<X> {
   void m() {}
 }
@@ -146,7 +146,7 @@
   }
 
   test_instanceCreation_optIn_fromOptOut_Null() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A<X extends int> {}
 ''');
 
@@ -222,7 +222,7 @@
   }
 
   test_methodInvocation_optIn_fromOptOut_Null() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class A {
   void m<X extends int>() {}
 ''');
@@ -340,7 +340,7 @@
   }
 
   test_redirectingConstructor_optIn_fromOptOut_Null() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'test.dart';
 
 class A<X extends int> implements B {}
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_class_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_class_test.dart
index 49bc006..1f28005 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_class_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_class_test.dart
@@ -67,7 +67,7 @@
   }
 
   test_ignore_part_exists_uriGenerated_nameIgnorable() async {
-    newFile2('$testPackageLibPath/a.g.dart', r'''
+    newFile('$testPackageLibPath/a.g.dart', r'''
 part of 'test.dart';
 ''');
 
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_hidden_name_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_hidden_name_test.dart
index 52e9002..e784169 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_hidden_name_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_hidden_name_test.dart
@@ -20,7 +20,7 @@
 
 mixin UndefinedHiddenNameTestCases on PubPackageResolutionTest {
   test_export() async {
-    newFile2('$testPackageLibPath/lib1.dart', '');
+    newFile('$testPackageLibPath/lib1.dart', '');
     await assertErrorsInCode(r'''
 export 'lib1.dart' hide a;
 ''', [
@@ -29,7 +29,7 @@
   }
 
   test_import() async {
-    newFile2('$testPackageLibPath/lib1.dart', '');
+    newFile('$testPackageLibPath/lib1.dart', '');
     await assertErrorsInCode(r'''
 import 'lib1.dart' hide a;
 ''', [
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart
index 89d58bb..ef7bce2 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_identifier_test.dart
@@ -371,7 +371,7 @@
   }
 
   test_private_getter() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 class A {
   var _foo;
@@ -389,7 +389,7 @@
   }
 
   test_private_setter() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 library lib;
 class A {
   var _foo;
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart
index bc446a2..ed18c21 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_method_test.dart
@@ -38,7 +38,7 @@
   }
 
   test_definedInPrivateExtension() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class B {}
 
 extension _ on B {
@@ -57,7 +57,7 @@
   }
 
   test_definedInUnnamedExtension() async {
-    newFile2('$testPackageLibPath/lib.dart', '''
+    newFile('$testPackageLibPath/lib.dart', '''
 class C {}
 
 extension on C {
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart
index 8cb6a74..61d78c99 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_prefixed_name_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class UndefinedPrefixedNameTest extends PubPackageResolutionTest {
   test_getterContext() async {
-    newFile2('$testPackageLibPath/lib.dart', '');
+    newFile('$testPackageLibPath/lib.dart', '');
     await assertErrorsInCode('''
 import 'lib.dart' as p;
 f() => p.c;
@@ -26,7 +26,7 @@
   }
 
   test_new() async {
-    newFile2('$testPackageLibPath/lib.dart', '');
+    newFile('$testPackageLibPath/lib.dart', '');
     await assertErrorsInCode(r'''
 import 'lib.dart' as p;
 void f() {
@@ -38,7 +38,7 @@
   }
 
   test_setterContext() async {
-    newFile2('$testPackageLibPath/lib.dart', '');
+    newFile('$testPackageLibPath/lib.dart', '');
     await assertErrorsInCode('''
 import 'lib.dart' as p;
 f() {
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart
index 0aedd03..f234428 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_setter_test.dart
@@ -151,7 +151,7 @@
 
 mixin UndefinedSetterTestCases on PubPackageResolutionTest {
   test_importWithPrefix_defined() async {
-    newFile2('$testPackageLibPath/lib.dart', r'''
+    newFile('$testPackageLibPath/lib.dart', r'''
 library lib;
 set y(int value) {}''');
     await assertNoErrorsInCode(r'''
diff --git a/pkg/analyzer/test/src/diagnostics/undefined_shown_name_test.dart b/pkg/analyzer/test/src/diagnostics/undefined_shown_name_test.dart
index 5839381..8dd50a6 100644
--- a/pkg/analyzer/test/src/diagnostics/undefined_shown_name_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/undefined_shown_name_test.dart
@@ -20,7 +20,7 @@
 
 mixin UndefinedShownNameTestCases on PubPackageResolutionTest {
   test_export() async {
-    newFile2('$testPackageLibPath/lib1.dart', '');
+    newFile('$testPackageLibPath/lib1.dart', '');
     await assertErrorsInCode(r'''
 export 'lib1.dart' show a;
 ''', [
@@ -29,7 +29,7 @@
   }
 
   test_import() async {
-    newFile2('$testPackageLibPath/lib1.dart', '');
+    newFile('$testPackageLibPath/lib1.dart', '');
     await assertErrorsInCode(r'''
 import 'lib1.dart' show a;
 ''', [
diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart
index 443694b..29b39a4 100644
--- a/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unnecessary_cast_test.dart
@@ -221,7 +221,7 @@
 class UnnecessaryCastTestWithNullSafety extends PubPackageResolutionTest
     with UnnecessaryCastTestCases {
   test_interfaceType_star_toNone() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 int a = 0;
 ''');
@@ -240,7 +240,7 @@
   }
 
   test_interfaceType_star_toQuestion() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.7
 int a = 0;
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_import_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_import_test.dart
index 7f08baa..26c4347 100644
--- a/pkg/analyzer/test/src/diagnostics/unnecessary_import_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unnecessary_import_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class UnnecessaryImportTest extends PubPackageResolutionTest {
   test_annotationOnDirective() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {
   const A() {}
 }
@@ -28,10 +28,10 @@
   }
 
   test_as() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', '''
+    newFile('$testPackageLibPath/lib2.dart', '''
 export 'lib1.dart';
 class B {}
 ''');
@@ -43,10 +43,10 @@
   }
 
   test_as_differentPrefixes() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', '''
+    newFile('$testPackageLibPath/lib2.dart', '''
 export 'lib1.dart';
 class B {}
 ''');
@@ -58,10 +58,10 @@
   }
 
   test_as_equalPrefixes_referenced() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 class B {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -72,13 +72,13 @@
   }
 
   test_as_equalPrefixes_referenced_via_export() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 class B {}
 ''');
-    newFile2('$testPackageLibPath/lib3.dart', r'''
+    newFile('$testPackageLibPath/lib3.dart', r'''
 export 'lib2.dart';
 ''');
     await assertNoErrorsInCode(r'''
@@ -89,10 +89,10 @@
   }
 
   test_as_equalPrefixes_unreferenced() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 class B {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -103,7 +103,7 @@
   }
 
   test_as_show_multipleElements() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 class B {}
 ''');
@@ -114,7 +114,7 @@
   }
 
   test_as_showTopLevelFunction() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class One {}
 topLevelFunction() {}
 ''');
@@ -128,7 +128,7 @@
   }
 
   test_as_showTopLevelFunction_multipleDirectives() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class One {}
 topLevelFunction() {}
 ''');
@@ -144,7 +144,7 @@
   }
 
   test_as_systemShadowing() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class File {}
 ''');
     await assertNoErrorsInCode('''
@@ -155,10 +155,10 @@
   }
 
   test_as_unnecessary() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', '''
+    newFile('$testPackageLibPath/lib2.dart', '''
 export 'lib1.dart';
 class B {}
 ''');
@@ -172,7 +172,7 @@
   }
 
   test_duplicteImport_differentPrefix() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class A {}
 class B {}
 ''');
@@ -184,10 +184,10 @@
   }
 
   test_hide() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', '''
+    newFile('$testPackageLibPath/lib2.dart', '''
 export 'lib1.dart' hide A;
 class B {}
 ''');
@@ -199,7 +199,7 @@
   }
 
   test_systemShadowing() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class File {}
 ''');
     await assertNoErrorsInCode('''
@@ -210,10 +210,10 @@
   }
 
   test_unnecessaryImport() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', '''
+    newFile('$testPackageLibPath/lib2.dart', '''
 export 'lib1.dart';
 class B {}
 ''');
@@ -227,10 +227,10 @@
   }
 
   test_unnecessaryImport_sameUri() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', '''
+    newFile('$testPackageLibPath/lib2.dart', '''
 export 'lib1.dart';
 class B {}
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_non_null_assertion_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_non_null_assertion_test.dart
index dd5dc92..f9c0618 100644
--- a/pkg/analyzer/test/src/diagnostics/unnecessary_non_null_assertion_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unnecessary_non_null_assertion_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class UnnecessaryNonNullAssertionTest extends PubPackageResolutionTest {
   test_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 var x = 0;
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/unnecessary_null_comparison_test.dart b/pkg/analyzer/test/src/diagnostics/unnecessary_null_comparison_test.dart
index 05e6462..a22d281 100644
--- a/pkg/analyzer/test/src/diagnostics/unnecessary_null_comparison_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unnecessary_null_comparison_test.dart
@@ -28,7 +28,7 @@
   }
 
   test_equal_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 var a = 0;
 ''');
@@ -91,7 +91,7 @@
   }
 
   test_notEqual_legacy() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 // @dart = 2.5
 var a = 0;
 ''');
diff --git a/pkg/analyzer/test/src/diagnostics/unused_import_test.dart b/pkg/analyzer/test/src/diagnostics/unused_import_test.dart
index 3279925..bb09122 100644
--- a/pkg/analyzer/test/src/diagnostics/unused_import_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unused_import_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class UnusedImportTest extends PubPackageResolutionTest {
   test_annotationOnDirective() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {
   const A() {}
 }
@@ -28,7 +28,7 @@
   }
 
   test_as() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 ''');
     await assertErrorsInCode(r'''
@@ -41,10 +41,10 @@
   }
 
   test_as_equalPrefixes_referenced() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 class B {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -56,13 +56,13 @@
   }
 
   test_as_equalPrefixes_referenced_via_export() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 class B {}
 ''');
-    newFile2('$testPackageLibPath/lib3.dart', r'''
+    newFile('$testPackageLibPath/lib3.dart', r'''
 export 'lib2.dart';
 ''');
     await assertNoErrorsInCode(r'''
@@ -74,10 +74,10 @@
   }
 
   test_as_equalPrefixes_unreferenced() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 class B {}
 ''');
     await assertErrorsInCode(r'''
@@ -90,7 +90,7 @@
   }
 
   test_as_show_multipleElements() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 class B {}
 ''');
@@ -102,7 +102,7 @@
   }
 
   test_as_showTopLevelFunction() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class One {}
 topLevelFunction() {}
 ''');
@@ -121,7 +121,7 @@
   }
 
   test_as_showTopLevelFunction_multipleDirectives() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class One {}
 topLevelFunction() {}
 ''');
@@ -139,7 +139,7 @@
   }
 
   test_as_systemLibrary() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class File {}
 ''');
     await assertErrorsInCode(r'''
@@ -158,11 +158,11 @@
   }
 
   test_export() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 export 'lib2.dart';
 class One {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 class Two {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -172,15 +172,15 @@
   }
 
   test_export2() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 export 'lib2.dart';
 class One {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 export 'lib3.dart';
 class Two {}
 ''');
-    newFile2('$testPackageLibPath/lib3.dart', r'''
+    newFile('$testPackageLibPath/lib3.dart', r'''
 class Three {}
 ''');
     await assertNoErrorsInCode(r'''
@@ -190,15 +190,15 @@
   }
 
   test_export_infiniteLoop() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 export 'lib2.dart';
 class One {}
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 export 'lib3.dart';
 class Two {}
 ''');
-    newFile2('$testPackageLibPath/lib3.dart', r'''
+    newFile('$testPackageLibPath/lib3.dart', r'''
 export 'lib2.dart';
 class Three {}
 ''');
@@ -209,7 +209,7 @@
   }
 
   test_extension_instance_call() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on int {
   int call(int x) => 0;
 }
@@ -224,7 +224,7 @@
   }
 
   test_extension_instance_getter() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   String get empty => '';
 }
@@ -239,7 +239,7 @@
   }
 
   test_extension_instance_method() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   String empty() => '';
 }
@@ -254,7 +254,7 @@
   }
 
   test_extension_instance_operator_binary() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   String operator -(String s) => this;
 }
@@ -269,7 +269,7 @@
   }
 
   test_extension_instance_operator_index() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on int {
   int operator [](int i) => 0;
 }
@@ -284,7 +284,7 @@
   }
 
   test_extension_instance_operator_unary() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   void operator -() {}
 }
@@ -299,7 +299,7 @@
   }
 
   test_extension_instance_setter() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   void set foo(int i) {}
 }
@@ -314,7 +314,7 @@
   }
 
   test_extension_override_getter() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   String get empty => '';
 }
@@ -329,7 +329,7 @@
   }
 
   test_extension_prefixed_isUsed() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   String empty() => '';
 }
@@ -344,7 +344,7 @@
   }
 
   test_extension_prefixed_notUsed() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   String empty() => '';
 }
@@ -357,7 +357,7 @@
   }
 
   test_extension_static_field() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   static const String empty = '';
 }
@@ -372,7 +372,7 @@
   }
 
   test_hide() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 ''');
     await assertErrorsInCode(r'''
@@ -392,7 +392,7 @@
   }
 
   test_metadata() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const x = 0;
 ''');
     await assertNoErrorsInCode(r'''
@@ -406,12 +406,12 @@
   }
 
   test_multipleExtensions() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   String a() => '';
 }
 ''');
-    newFile2('$testPackageLibPath/lib2.dart', r'''
+    newFile('$testPackageLibPath/lib2.dart', r'''
 extension E on String {
   String b() => '';
 }
@@ -429,7 +429,7 @@
   }
 
   test_show() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 class B {}
 ''');
@@ -443,7 +443,7 @@
   }
 
   test_systemLibrary() async {
-    newFile2('$testPackageLibPath/lib1.dart', '''
+    newFile('$testPackageLibPath/lib1.dart', '''
 class File {}
 ''');
     await assertErrorsInCode(r'''
@@ -456,7 +456,7 @@
   }
 
   test_unusedImport() async {
-    newFile2('$testPackageLibPath/lib1.dart', '');
+    newFile('$testPackageLibPath/lib1.dart', '');
     await assertErrorsInCode(r'''
 import 'lib1.dart';
 ''', [
diff --git a/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart b/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart
index 3f0c9a4..e26c77c 100644
--- a/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/unused_shown_name_test.dart
@@ -16,7 +16,7 @@
 @reflectiveTest
 class UnusedShownNameTest extends PubPackageResolutionTest {
   test_extension_instance_method_unused() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   String empty() => '';
 }
@@ -34,7 +34,7 @@
   }
 
   test_extension_instance_method_used() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 extension E on String {
   String empty() => '';
 }
@@ -49,7 +49,7 @@
   }
 
   test_referenced_prefixed_assignmentExpression() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var a = 0;
 ''');
 
@@ -63,7 +63,7 @@
   }
 
   test_referenced_prefixed_postfixExpression() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var a = 0;
 ''');
 
@@ -77,7 +77,7 @@
   }
 
   test_referenced_prefixed_prefixExpression() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var a = 0;
 ''');
 
@@ -91,7 +91,7 @@
   }
 
   test_referenced_unprefixed_assignmentExpression() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var a = 0;
 ''');
 
@@ -105,7 +105,7 @@
   }
 
   test_referenced_unprefixed_postfixExpression() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var a = 0;
 ''');
 
@@ -119,7 +119,7 @@
   }
 
   test_referenced_unprefixed_prefixExpression() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 var a = 0;
 ''');
 
@@ -133,7 +133,7 @@
   }
 
   test_unreferenced() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 class B {}
 ''');
@@ -157,7 +157,7 @@
   }
 
   test_unusedShownName_as() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 class B {}
 ''');
@@ -170,7 +170,7 @@
   }
 
   test_unusedShownName_duplicates() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 class A {}
 class B {}
 class C {}
@@ -188,7 +188,7 @@
   }
 
   test_unusedShownName_topLevelVariable() async {
-    newFile2('$testPackageLibPath/lib1.dart', r'''
+    newFile('$testPackageLibPath/lib1.dart', r'''
 const int var1 = 1;
 const int var2 = 2;
 const int var3 = 3;
diff --git a/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_test.dart b/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_test.dart
index b411c0c..686453c 100644
--- a/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/uri_does_not_exist_test.dart
@@ -43,7 +43,7 @@
   }
 
   test_import_appears_after_deleting_target() async {
-    String filePath = newFile2('$testPackageLibPath/target.dart', '').path;
+    String filePath = newFile('$testPackageLibPath/target.dart', '').path;
 
     await assertErrorsInCode('''
 import 'target.dart';
@@ -72,7 +72,7 @@
       error(CompileTimeErrorCode.URI_DOES_NOT_EXIST, 7, 13),
     ]);
 
-    newFile2('$testPackageLibPath/target.dart', '');
+    newFile('$testPackageLibPath/target.dart', '');
 
     // Make sure the error goes away.
     // TODO(brianwilkerson) The error does not go away, possibly because the
diff --git a/pkg/analyzer/test/src/hint/sdk_constraint_extractor_test.dart b/pkg/analyzer/test/src/hint/sdk_constraint_extractor_test.dart
index b02ead8..78f5293 100644
--- a/pkg/analyzer/test/src/hint/sdk_constraint_extractor_test.dart
+++ b/pkg/analyzer/test/src/hint/sdk_constraint_extractor_test.dart
@@ -18,7 +18,7 @@
 class SdkConstraintExtractorTest with ResourceProviderMixin {
   SdkConstraintExtractor extractorFor(String pubspecContent) {
     String pubspecPath = '/pkg/test/pubspec.yaml';
-    File pubspecFile = newFile2(pubspecPath, pubspecContent);
+    File pubspecFile = newFile(pubspecPath, pubspecContent);
     return SdkConstraintExtractor(pubspecFile);
   }
 
diff --git a/pkg/analyzer/test/src/lint/linter/linter_context_impl_test.dart b/pkg/analyzer/test/src/lint/linter/linter_context_impl_test.dart
index 6e1f3c9..2f30335 100644
--- a/pkg/analyzer/test/src/lint/linter/linter_context_impl_test.dart
+++ b/pkg/analyzer/test/src/lint/linter/linter_context_impl_test.dart
@@ -244,7 +244,7 @@
   }
 
   void test_true_computeDependencies() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const a = 0;
 ''');
 
@@ -285,7 +285,7 @@
 
   void test_true_importedClass_defaultValue() async {
     var aPath = convertPath('$testPackageLibPath/a.dart');
-    newFile2(aPath, r'''
+    newFile(aPath, r'''
 class A {
   final int a;
   const A({int b = 1}) : a = b * 2;
@@ -334,7 +334,7 @@
   }
 
   void test_listLiteral_true_computeDependencies() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const a = 0;
 ''');
 
@@ -499,7 +499,7 @@
   }
 
   test_hasValue_constantReference_imported() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 const a = 42;
 ''');
     await resolve('''
diff --git a/pkg/analyzer/test/src/lint/linter/resolve_name_in_scope_test.dart b/pkg/analyzer/test/src/lint/linter/resolve_name_in_scope_test.dart
index 37080e4..e619e0d 100644
--- a/pkg/analyzer/test/src/lint/linter/resolve_name_in_scope_test.dart
+++ b/pkg/analyzer/test/src/lint/linter/resolve_name_in_scope_test.dart
@@ -46,7 +46,7 @@
   }
 
   test_class_getter_different_importScope() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 set foo(int _) {}
 ''');
     await resolve('''
@@ -116,7 +116,7 @@
   }
 
   test_class_getter_requested_importScope() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 int get foo => 0;
 ''');
     await resolve('''
@@ -276,7 +276,7 @@
   }
 
   test_class_method_requested_importScope() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 void foo() {}
 ''');
     await resolve('''
@@ -530,7 +530,7 @@
   }
 
   test_class_setter_requested_importScope() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 set foo(int _) {}
 ''');
     await resolve('''
diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/asset_does_not_exist_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/asset_does_not_exist_test.dart
index 00030c8..2aa85c7 100644
--- a/pkg/analyzer/test/src/pubspec/diagnostics/asset_does_not_exist_test.dart
+++ b/pkg/analyzer/test/src/pubspec/diagnostics/asset_does_not_exist_test.dart
@@ -25,7 +25,7 @@
   }
 
   test_assetDoesNotExist_path_inRoot_noError() {
-    newFile2('/sample/assets/my_icon.png', '');
+    newFile('/sample/assets/my_icon.png', '');
     assertNoErrors('''
 name: sample
 flutter:
@@ -35,7 +35,7 @@
   }
 
   test_assetDoesNotExist_path_inSubdir_noError() {
-    newFile2('/sample/assets/images/2.0x/my_icon.png', '');
+    newFile('/sample/assets/images/2.0x/my_icon.png', '');
     assertNoErrors('''
 name: sample
 flutter:
diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/asset_field_not_list_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/asset_field_not_list_test.dart
index d0ca77d..f7a1975 100644
--- a/pkg/analyzer/test/src/pubspec/diagnostics/asset_field_not_list_test.dart
+++ b/pkg/analyzer/test/src/pubspec/diagnostics/asset_field_not_list_test.dart
@@ -32,7 +32,7 @@
   }
 
   test_assetFieldNotList_noError() {
-    newFile2('/sample/assets/my_icon.png', '');
+    newFile('/sample/assets/my_icon.png', '');
     assertNoErrors('''
 name: sample
 flutter:
diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/asset_not_string_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/asset_not_string_test.dart
index 298d360..fe8b087 100644
--- a/pkg/analyzer/test/src/pubspec/diagnostics/asset_not_string_test.dart
+++ b/pkg/analyzer/test/src/pubspec/diagnostics/asset_not_string_test.dart
@@ -36,7 +36,7 @@
   }
 
   test_assetNotString_noError() {
-    newFile2('/sample/assets/my_icon.png', '');
+    newFile('/sample/assets/my_icon.png', '');
     assertNoErrors('''
 name: sample
 flutter:
diff --git a/pkg/analyzer/test/src/pubspec/diagnostics/flutter_field_not_map_test.dart b/pkg/analyzer/test/src/pubspec/diagnostics/flutter_field_not_map_test.dart
index 09e5955..3a5be60 100644
--- a/pkg/analyzer/test/src/pubspec/diagnostics/flutter_field_not_map_test.dart
+++ b/pkg/analyzer/test/src/pubspec/diagnostics/flutter_field_not_map_test.dart
@@ -36,7 +36,7 @@
   }
 
   test_flutterFieldNotMap_noError() {
-    newFile2('/sample/assets/my_icon.png', '');
+    newFile('/sample/assets/my_icon.png', '');
     assertNoErrors('''
 name: sample
 flutter:
diff --git a/pkg/analyzer/test/src/services/available_declarations_test.dart b/pkg/analyzer/test/src/services/available_declarations_test.dart
index 84e997f..63ce98c 100644
--- a/pkg/analyzer/test/src/services/available_declarations_test.dart
+++ b/pkg/analyzer/test/src/services/available_declarations_test.dart
@@ -66,7 +66,7 @@
         buffer.writeln('    - $experiment');
       }
     }
-    newFile2(analysisOptionsPath, buffer.toString());
+    newFile(analysisOptionsPath, buffer.toString());
 
     createAnalysisContexts();
   }
@@ -121,7 +121,7 @@
 @reflectiveTest
 class AvailableDeclarationsTest extends _Base {
   test_changesStream_noDuplicates() async {
-    newFile2('/home/aaa/lib/a.dart', 'class A {}');
+    newFile('/home/aaa/lib/a.dart', 'class A {}');
 
     newPubspecYamlFile('/home/bbb', r'''
 dependencies:
@@ -131,7 +131,7 @@
       '/home/bbb',
       PackageConfigFileBuilder()..add(name: 'aaa', rootPath: '/home/aaa'),
     );
-    newFile2('/home/bbb/lib/b.dart', 'class B {}');
+    newFile('/home/bbb/lib/b.dart', 'class B {}');
 
     newPubspecYamlFile('/home/ccc', r'''
 dependencies:
@@ -141,7 +141,7 @@
       '/home/ccc',
       PackageConfigFileBuilder()..add(name: 'aaa', rootPath: '/home/aaa'),
     );
-    newFile2('/home/ccc/lib/c.dart', 'class C {}');
+    newFile('/home/ccc/lib/c.dart', 'class C {}');
 
     createAnalysisContexts();
 
@@ -166,7 +166,7 @@
   }
 
   test_discardContexts() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 class A {}
 ''');
 
@@ -189,7 +189,7 @@
   }
 
   test_getContext() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 class B {}
 ''');
@@ -198,7 +198,7 @@
   }
 
   test_getLibrary() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 class C {}
 ''');
     tracker.addContext(testAnalysisContext);
@@ -212,7 +212,7 @@
   }
 
   test_getLibrary_export_notExisting() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 export 'b.dart';
 class A {}
 ''');
@@ -231,7 +231,7 @@
       convertPath('/home/test/lib'),
     );
 
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 export 'foo/a.dart';
 class A {}
 ''');
@@ -245,13 +245,13 @@
   }
 
   test_readByteStore() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 ''');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/b.dart', r'''
 class B {}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 export 'a.dart' show A;
 part 'b.dart';
 class C {}
@@ -296,10 +296,10 @@
     var a = convertPath('/home/test/lib/a.dart');
     var b = convertPath('/home/test/lib/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 part 'a.dart';
 class B {}
 ''');
@@ -316,7 +316,7 @@
       ]),
     ]);
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A2 {}
 ''');
     tracker.changeFile(a);
@@ -342,15 +342,15 @@
     var c = convertPath('/home/test/lib/c.dart');
     var d = convertPath('/home/test/lib/d.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 export 'b.dart';
 class A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 export 'c.dart';
 class B {}
 ''');
-    newFile2(d, r'''
+    newFile(d, r'''
 class D {}
 ''');
     tracker.addContext(testAnalysisContext);
@@ -376,7 +376,7 @@
       ]),
     ]);
 
-    newFile2(c, r'''
+    newFile(c, r'''
 class C {}
 ''');
     tracker.changeFile(c);
@@ -417,7 +417,7 @@
     var a = convertPath('/home/test/lib/a.dart');
     var b = convertPath('/home/test/lib/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A {}
 ''');
     var declarationsContext = tracker.addContext(testAnalysisContext);
@@ -430,7 +430,7 @@
     ]);
     _assertHasNoLibrary('package:test/b.dart');
 
-    newFile2(b, r'''
+    newFile(b, r'''
 class B {}
 ''');
     tracker.changeFile(b);
@@ -461,11 +461,11 @@
     var b = convertPath('/home/test/lib/b.dart');
     var c = convertPath('/home/test/lib/c.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part 'b.dart';
 class A {}
 ''');
-    newFile2(c, r'''
+    newFile(c, r'''
 class C {}
 ''');
     tracker.addContext(testAnalysisContext);
@@ -483,7 +483,7 @@
       ]),
     ]);
 
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 class B {}
 ''');
@@ -509,7 +509,7 @@
   test_added_part_withoutLibrary() async {
     var b = convertPath('/home/test/lib/b.dart');
 
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 ''');
     tracker.changeFile(b);
@@ -531,7 +531,7 @@
     tracker.addContext(testContext);
     await _doAllTrackerWork();
 
-    newFile2(filePath, 'class A {}');
+    newFile(filePath, 'class A {}');
     uriToLibrary.clear();
     tracker.changeFile(filePath);
     await _doAllTrackerWork();
@@ -546,7 +546,7 @@
       relevanceTags: ['ElementKind.CLASS', 'package:test/test.dart::A'],
     );
 
-    newFile2(filePath, 'class B {}');
+    newFile(filePath, 'class B {}');
     uriToLibrary.clear();
     tracker.changeFile(filePath);
     await _doAllTrackerWork();
@@ -583,7 +583,7 @@
     tracker.addContext(testContext);
     await _doAllTrackerWork();
 
-    newFile2(filePath, 'class A {}');
+    newFile(filePath, 'class A {}');
     uriToLibrary.clear();
     tracker.changeFile(filePath);
     await _doAllTrackerWork();
@@ -598,7 +598,7 @@
       relevanceTags: ['ElementKind.CLASS', 'package:aaa/a.dart::A'],
     );
 
-    newFile2(filePath, 'class B {}');
+    newFile(filePath, 'class B {}');
     uriToLibrary.clear();
     tracker.changeFile(filePath);
     await _doAllTrackerWork();
@@ -620,7 +620,7 @@
     tracker.addContext(testAnalysisContext);
     await _doAllTrackerWork();
 
-    newFile2(filePath, 'class A {}');
+    newFile(filePath, 'class A {}');
     uriToLibrary.clear();
     tracker.changeFile(filePath);
     await _doAllTrackerWork();
@@ -635,7 +635,7 @@
       relevanceTags: ['ElementKind.CLASS', 'dart:math::A'],
     );
 
-    newFile2(filePath, 'class B {}');
+    newFile(filePath, 'class B {}');
     uriToLibrary.clear();
     tracker.changeFile(filePath);
     await _doAllTrackerWork();
@@ -657,18 +657,18 @@
     var c = convertPath('/home/test/lib/c.dart');
     var d = convertPath('/home/test/lib/d.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 export 'b.dart';
 class A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 export 'c.dart';
 class B {}
 ''');
-    newFile2(c, r'''
+    newFile(c, r'''
 class C {}
 ''');
-    newFile2(d, r'''
+    newFile(d, r'''
 class D {}
 ''');
     tracker.addContext(testAnalysisContext);
@@ -733,8 +733,8 @@
     var a = convertPath('/home/test/lib/a.dart');
     var b = convertPath('/home/test/lib/b.dart');
 
-    newFile2(a, '');
-    newFile2(b, '');
+    newFile(a, '');
+    newFile(b, '');
     tracker.addContext(testAnalysisContext);
 
     await _doAllTrackerWork();
@@ -753,10 +753,10 @@
     var a = convertPath('/home/test/lib/a.dart');
     var b = convertPath('/home/test/lib/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part 'b.dart';
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 ''');
     tracker.addContext(testAnalysisContext);
@@ -778,15 +778,15 @@
     var b = convertPath('/home/test/lib/b.dart');
     var c = convertPath('/home/test/lib/c.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part 'b.dart';
 class A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 class B {}
 ''');
-    newFile2(c, r'''
+    newFile(c, r'''
 class C {}
 ''');
     tracker.addContext(testAnalysisContext);
@@ -825,7 +825,7 @@
   test_deleted_part_withoutLibrary() async {
     var b = convertPath('/home/test/lib/b.dart');
 
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 ''');
     tracker.addContext(testAnalysisContext);
@@ -841,18 +841,18 @@
     var c = convertPath('/home/test/lib/c.dart');
     var d = convertPath('/home/test/lib/d.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 export 'b.dart';
 class A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 export 'c.dart';
 class B {}
 ''');
-    newFile2(c, r'''
+    newFile(c, r'''
 class C {}
 ''');
-    newFile2(d, r'''
+    newFile(d, r'''
 class D {}
 ''');
     tracker.addContext(testAnalysisContext);
@@ -888,7 +888,7 @@
       ]),
     ]);
 
-    newFile2(c, r'''
+    newFile(c, r'''
 class C2 {}
 ''');
     tracker.changeFile(c);
@@ -931,13 +931,13 @@
     var b = convertPath('/home/test/lib/b.dart');
     var c = convertPath('/home/test/lib/c.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 class B {}
 ''');
-    newFile2(c, r'''
+    newFile(c, r'''
 export 'a.dart';
 export 'b.dart';
 class C {}
@@ -959,10 +959,10 @@
 
     changes.clear();
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A2 {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 class B2 {}
 ''');
     tracker.changeFile(a);
@@ -998,10 +998,10 @@
     var a = convertPath('/home/test/lib/a.dart');
     var b = convertPath('/home/test/lib/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 class B {}
 ''');
     tracker.addContext(testAnalysisContext);
@@ -1018,7 +1018,7 @@
       ]),
     ]);
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A2 {}
 ''');
     tracker.changeFile(a);
@@ -1041,11 +1041,11 @@
     var a = convertPath('/home/test/lib/a.dart');
     var b = convertPath('/home/test/lib/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part 'b.dart';
 class A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 class B {}
 ''');
@@ -1067,7 +1067,7 @@
       relevanceTags: ['ElementKind.CLASS', 'package:test/a.dart::B'],
     );
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part 'b.dart';
 class A2 {}
 ''');
@@ -1093,7 +1093,7 @@
   test_updated_library_to_part() async {
     var a = convertPath('/home/test/lib/a.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A {}
 ''');
     tracker.addContext(testAnalysisContext);
@@ -1105,7 +1105,7 @@
       ]),
     ]);
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part of nothing;
 class A {}
 ''');
@@ -1113,7 +1113,7 @@
     await _doAllTrackerWork();
     _assertHasNoLibrary('package:test/a.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 class A2 {}
 ''');
     tracker.changeFile(a);
@@ -1130,15 +1130,15 @@
     var b = convertPath('/home/test/lib/b.dart');
     var c = convertPath('/home/test/lib/c.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part 'b.dart';
 class A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 class B {}
 ''');
-    newFile2(c, r'''
+    newFile(c, r'''
 class C {}
 ''');
     tracker.addContext(testAnalysisContext);
@@ -1158,7 +1158,7 @@
       ]),
     ]);
 
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 class B2 {}
 ''');
@@ -1184,11 +1184,11 @@
     var a = convertPath('/home/test/lib/a.dart');
     var b = convertPath('/home/test/lib/b.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part of unknown;
 class A {}
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 export 'a.dart';
 class B {}
 ''');
@@ -1202,7 +1202,7 @@
       ]),
     ]);
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part of unknown;
 class A2 {}
 ''');
@@ -1219,7 +1219,7 @@
   test_updated_part_withoutLibrary() async {
     var b = convertPath('/home/test/lib/b.dart');
 
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 class B {}
 ''');
@@ -1229,7 +1229,7 @@
     _assertHasNoLibrary('package:test/a.dart');
     _assertHasNoLibrary('package:test/b.dart');
 
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 class B2 {}
 ''');
@@ -1244,7 +1244,7 @@
 @reflectiveTest
 class DartdocInfoTest extends _Base {
   test_samePackage() async {
-    File file = newFile2('/home/aaa/lib/definition.dart', '''
+    File file = newFile('/home/aaa/lib/definition.dart', '''
 /// {@template foo}
 /// Body of the template.
 /// {@endtemplate}
@@ -1273,7 +1273,7 @@
 @reflectiveTest
 class DeclarationTest extends _Base {
   test_CLASS() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 class A {}
 
 abstract class B {}
@@ -1323,7 +1323,7 @@
   }
 
   test_class_FIELD() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 class C {
   static int f1 = 0;
 
@@ -1428,7 +1428,7 @@
   }
 
   test_class_GETTER() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 class C {
   static int get g1 => 0;
 
@@ -1485,7 +1485,7 @@
   }
 
   test_class_METHOD() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 class C {
   static void m1() {}
 
@@ -1573,7 +1573,7 @@
   }
 
   test_class_SETTER() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 class C {
   static set s1(int value) {}
 
@@ -1642,7 +1642,7 @@
   }
 
   test_CLASS_TYPE_ALIAS() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 mixin M {}
 
 class A = Object with M;
@@ -1684,7 +1684,7 @@
   }
 
   test_CONSTRUCTOR() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 class C {
   int f1;
   int f2;
@@ -1789,7 +1789,7 @@
   }
 
   test_ENUM() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 enum A {v}
 
 @deprecated
@@ -1829,7 +1829,7 @@
   }
 
   test_ENUM_CONSTANT() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 enum MyEnum {
   a,
 
@@ -1886,7 +1886,7 @@
 
   test_EXTENSION() async {
     createAnalysisOptionsFile(experiments: [EnableString.extension_methods]);
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 extension A on String {}
 
 extension on String {}
@@ -1929,7 +1929,7 @@
   }
 
   test_FUNCTION() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 void a() {}
 
 @deprecated
@@ -2013,7 +2013,7 @@
   }
 
   test_FUNCTION_defaultArgumentList() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 void a() {}
 
 void b(int a, double bb, String ccc) {}
@@ -2080,7 +2080,7 @@
   }
 
   test_FUNCTION_TYPE_ALIAS() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 typedef A = void Function();
 
 @deprecated
@@ -2193,7 +2193,7 @@
   }
 
   test_FUNCTION_TYPE_ALIAS_noFunction() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 typedef A = ;
 ''');
 
@@ -2205,7 +2205,7 @@
   }
 
   test_FUNCTION_TYPE_ALIAS_old() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 typedef void A();
 
 @deprecated
@@ -2318,7 +2318,7 @@
   }
 
   test_GETTER() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 int get a => 0;
 
 @deprecated
@@ -2361,12 +2361,12 @@
   }
 
   test_library_isDeprecated() async {
-    newFile2('/home/test/lib/a.dart', '');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/a.dart', '');
+    newFile('/home/test/lib/b.dart', r'''
 @deprecated
 library my.lib;
 ''');
-    newFile2('/home/test/lib/c.dart', r'''
+    newFile('/home/test/lib/c.dart', r'''
 @Deprecated('description')
 library my.lib;
 ''');
@@ -2380,7 +2380,7 @@
   }
 
   test_library_partDirective_empty() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 part ' ';
 
 class A {}
@@ -2399,7 +2399,7 @@
   }
 
   test_library_partDirective_incomplete() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 part
 
 class A {}
@@ -2418,15 +2418,15 @@
   }
 
   test_library_parts() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 part of 'test.dart';
 class A {}
 ''');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/b.dart', r'''
 part of 'test.dart';
 class B {}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 part 'a.dart';
 part 'b.dart';
 class C {}
@@ -2448,12 +2448,12 @@
   }
 
   test_library_publicOnly() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 part of 'test.dart';
 class A {}
 class _A {}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 part 'a.dart';
 class B {}
 class _B {}
@@ -2472,12 +2472,12 @@
   }
 
   test_library_publicOnly_enum() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 part of 'test.dart';
 enum A {a, _a}
 enum _A {a, _a}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 part 'a.dart';
 enum B {b, _b}
 enum _B {b, _b}
@@ -2501,7 +2501,7 @@
 
 class B {}
 ''';
-    var testPath = newFile2('/home/test/lib/test.dart', code).path;
+    var testPath = newFile('/home/test/lib/test.dart', code).path;
 
     tracker.addContext(testAnalysisContext);
     await _doAllTrackerWork();
@@ -2530,7 +2530,7 @@
   }
 
   test_MIXIN() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 mixin A {}
 
 @deprecated
@@ -2571,7 +2571,7 @@
   }
 
   test_SETTER() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 set a(int value) {}
 
 @deprecated
@@ -2623,7 +2623,7 @@
   }
 
   test_TYPE_ALIAS() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 typedef A = double;
 
 @deprecated
@@ -2678,7 +2678,7 @@
   }
 
   test_VARIABLE() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 int a;
 
 @deprecated
@@ -2748,7 +2748,7 @@
 @reflectiveTest
 class ExportTest extends _Base {
   test_classTypeAlias() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 mixin M {}
 class A = Object with M;
 ''');
@@ -2762,12 +2762,12 @@
   }
 
   test_combinators_hide() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 class B {}
 class C {}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 export 'a.dart' hide B;
 class D {}
 ''');
@@ -2788,12 +2788,12 @@
   }
 
   test_combinators_show() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 class B {}
 class C {}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 export 'a.dart' show B;
 class D {}
 ''');
@@ -2811,11 +2811,11 @@
   }
 
   test_combinators_show_enum() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 enum E1 {a}
 enum E2 {b}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 export 'a.dart' show E1;
 ''');
     tracker.addContext(testAnalysisContext);
@@ -2829,15 +2829,15 @@
   }
 
   test_cycle() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 export 'b.dart';
 class A {}
 ''');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/b.dart', r'''
 export 'a.dart';
 class B {}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 export 'b.dart';
 class C {}
 ''');
@@ -2877,7 +2877,7 @@
   }
 
   test_enum() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 enum E1 {a, b}
 enum E2 {a, b}
 ''');
@@ -2897,7 +2897,7 @@
   }
 
   test_function() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 int foo() => 0;
 int bar() => 0;
 ''');
@@ -2911,7 +2911,7 @@
   }
 
   test_functionTypeAlias() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 typedef F = int Function();
 ''');
     tracker.addContext(testAnalysisContext);
@@ -2923,7 +2923,7 @@
   }
 
   test_missing() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 export 'a.dart';
 class C {}
 ''');
@@ -2938,14 +2938,14 @@
   }
 
   test_sequence() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 ''');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/b.dart', r'''
 export 'a.dart';
 class B {}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 export 'b.dart';
 class C {}
 ''');
@@ -2982,11 +2982,11 @@
   }
 
   test_shadowedByLocal() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 class B {}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 export 'a.dart';
 
 mixin B {}
@@ -3003,11 +3003,11 @@
   }
 
   test_simple() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 class B {}
 ''');
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 export 'a.dart';
 class C {}
 ''');
@@ -3028,7 +3028,7 @@
   }
 
   test_variable() async {
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 int foo = 0;
 ''');
     tracker.addContext(testAnalysisContext);
@@ -3047,9 +3047,9 @@
     var b = convertPath('/home/test/lib/b.dart');
     var c = convertPath('/home/test/lib/c.dart');
 
-    newFile2(a, '');
-    newFile2(b, '');
-    newFile2(c, '');
+    newFile(a, '');
+    newFile(b, '');
+    newFile(c, '');
 
     var context = tracker.addContext(testAnalysisContext);
     await _doAllTrackerWork();
@@ -3078,13 +3078,13 @@
     var b = convertPath('/home/test/lib/b.dart');
     var c = convertPath('/home/test/lib/c.dart');
 
-    newFile2(a, r'''
+    newFile(a, r'''
 part 'b.dart';
 ''');
-    newFile2(b, r'''
+    newFile(b, r'''
 part of 'a.dart';
 ''');
-    newFile2(c, '');
+    newFile(c, '');
 
     var context = tracker.addContext(testAnalysisContext);
     await _doAllTrackerWork();
@@ -3100,14 +3100,14 @@
   }
 
   test_pub() async {
-    newFile2('/home/aaa/lib/a.dart', 'class A {}');
-    newFile2('/home/aaa/lib/src/a2.dart', 'class A2 {}');
+    newFile('/home/aaa/lib/a.dart', 'class A {}');
+    newFile('/home/aaa/lib/src/a2.dart', 'class A2 {}');
 
-    newFile2('/home/bbb/lib/b.dart', 'class B {}');
-    newFile2('/home/bbb/lib/src/b2.dart', 'class B2 {}');
+    newFile('/home/bbb/lib/b.dart', 'class B {}');
+    newFile('/home/bbb/lib/src/b2.dart', 'class B2 {}');
 
-    newFile2('/home/ccc/lib/c.dart', 'class C {}');
-    newFile2('/home/ccc/lib/src/c2.dart', 'class C2 {}');
+    newFile('/home/ccc/lib/c.dart', 'class C {}');
+    newFile('/home/ccc/lib/src/c2.dart', 'class C2 {}');
 
     newPubspecYamlFile('/home/test', r'''
 name: test
@@ -3116,10 +3116,10 @@
 dev_dependencies:
   bbb: any
 ''');
-    newFile2('/home/test/lib/t.dart', 'class T {}');
-    newFile2('/home/test/lib/src/t2.dart', 'class T2 {}');
-    newFile2('/home/test/bin/t3.dart', 'class T3 {}');
-    newFile2('/home/test/test/t4.dart', 'class T4 {}');
+    newFile('/home/test/lib/t.dart', 'class T {}');
+    newFile('/home/test/lib/src/t2.dart', 'class T2 {}');
+    newFile('/home/test/bin/t3.dart', 'class T3 {}');
+    newFile('/home/test/test/t4.dart', 'class T4 {}');
 
     newPubspecYamlFile('/home/test/samples/basic', r'''
 name: test
@@ -3127,7 +3127,7 @@
   ccc: any
   test: any
 ''');
-    newFile2('/home/test/samples/basic/lib/s.dart', 'class S {}');
+    newFile('/home/test/samples/basic/lib/s.dart', 'class S {}');
 
     writeTestPackageConfig(
       PackageConfigFileBuilder()
@@ -3283,7 +3283,7 @@
   }
 
   test_sdk_excludesPrivate() async {
-    newFile2('/home/test/lib/test.dart', '');
+    newFile('/home/test/lib/test.dart', '');
 
     var context = tracker.addContext(testAnalysisContext);
     await _doAllTrackerWork();
@@ -3297,15 +3297,15 @@
   }
 
   test_setDependencies() async {
-    newFile2('/home/aaa/lib/a.dart', r'''
+    newFile('/home/aaa/lib/a.dart', r'''
 export 'src/a2.dart' show A2;
 class A1 {}
 ''');
-    newFile2('/home/aaa/lib/src/a2.dart', r'''
+    newFile('/home/aaa/lib/src/a2.dart', r'''
 class A2 {}
 class A3 {}
 ''');
-    newFile2('/home/bbb/lib/b.dart', r'''
+    newFile('/home/bbb/lib/b.dart', r'''
 class B {}
 ''');
 
@@ -3315,9 +3315,9 @@
         ..add(name: 'bbb', rootPath: '/home/bbb'),
     );
 
-    newFile2('/home/test/lib/t.dart', 'class T {}');
-    newFile2('/home/test/lib/src/t2.dart', 'class T2 {}');
-    newFile2('/home/test/test/t3.dart', 'class T3 {}');
+    newFile('/home/test/lib/t.dart', 'class T {}');
+    newFile('/home/test/lib/src/t2.dart', 'class T2 {}');
+    newFile('/home/test/test/t3.dart', 'class T3 {}');
 
     var context = tracker.addContext(testAnalysisContext);
     context.setDependencies({
@@ -3410,10 +3410,10 @@
   }
 
   test_setDependencies_twice() async {
-    newFile2('/home/aaa/lib/a.dart', r'''
+    newFile('/home/aaa/lib/a.dart', r'''
 class A {}
 ''');
-    newFile2('/home/bbb/lib/b.dart', r'''
+    newFile('/home/bbb/lib/b.dart', r'''
 class B {}
 ''');
 
@@ -3423,7 +3423,7 @@
         ..add(name: 'bbb', rootPath: '/home/bbb'),
     );
 
-    newFile2('/home/test/lib/test.dart', r'''
+    newFile('/home/test/lib/test.dart', r'''
 class C {}
 ''');
 
@@ -3488,9 +3488,9 @@
     var b = convertPath('/home/test/bin/b.dart');
     var c = convertPath('/home/test/bin/c.dart');
 
-    newFile2(a, 'class A {}');
-    newFile2(b, 'class B {}');
-    newFile2(c, 'class C {}');
+    newFile(a, 'class A {}');
+    newFile(b, 'class B {}');
+    newFile(c, 'class C {}');
     testAnalysisContext.currentSession.getFile(a);
     testAnalysisContext.currentSession.getFile(b);
     testAnalysisContext.currentSession.getFile(c);
diff --git a/pkg/analyzer/test/src/summary/elements_base.dart b/pkg/analyzer/test/src/summary/elements_base.dart
index 83d47b0..0c30670 100644
--- a/pkg/analyzer/test/src/summary/elements_base.dart
+++ b/pkg/analyzer/test/src/summary/elements_base.dart
@@ -126,7 +126,7 @@
   String get workspaceRootPath => '/home';
 
   void addSource(String path, String contents) {
-    newFile2(path, contents);
+    newFile(path, contents);
   }
 
   Future<LibraryElementImpl> buildLibrary(
@@ -135,7 +135,7 @@
     bool dumpSummaries = false,
     List<Set<String>>? preBuildSequence,
   }) async {
-    var testFile = newFile2(testFilePath, text);
+    var testFile = newFile(testFilePath, text);
     var testUri = sourceFactory.pathToUri(testFile.path)!;
     var testSource = sourceFactory.forUri2(testUri)!;
 
diff --git a/pkg/analyzer/test/src/summary/elements_test.dart b/pkg/analyzer/test/src/summary/elements_test.dart
index 810c873..5d2bb23 100644
--- a/pkg/analyzer/test/src/summary/elements_test.dart
+++ b/pkg/analyzer/test/src/summary/elements_test.dart
@@ -36587,7 +36587,7 @@
   }
 
   test_typedef_nonFunction_using_interface_noTypeParameters_legacy() async {
-    newFile2('/a.dart', r'''
+    newFile('/a.dart', r'''
 typedef A = List<int>;
 ''');
     var library = await buildLibrary(r'''
diff --git a/pkg/analyzer/test/src/summary/macro_test.dart b/pkg/analyzer/test/src/summary/macro_test.dart
index 51443a5..0c3f764 100644
--- a/pkg/analyzer/test/src/summary/macro_test.dart
+++ b/pkg/analyzer/test/src/summary/macro_test.dart
@@ -258,7 +258,7 @@
   }
 
   test_build_types() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'dart:async';
 import 'package:_fe_analyzer_shared/src/macros/api.dart';
 
@@ -475,7 +475,7 @@
       return "$name: \$$name\\\\n";
     }).join('');
 
-    newFile2('$testPackageLibPath/arguments_text.dart', '''
+    newFile('$testPackageLibPath/arguments_text.dart', '''
 import 'dart:async';
 import 'package:_fe_analyzer_shared/src/macros/api.dart';
 
@@ -547,7 +547,7 @@
   /// the textual dump of the introspection information for the first
   /// declaration.
   Future<String> _getDeclarationText(String declarationCode) async {
-    newFile2(
+    newFile(
       '$testPackageLibPath/declaration_text.dart',
       _declarationTextCode,
     );
diff --git a/pkg/analyzer/test/src/summary/top_level_inference_test.dart b/pkg/analyzer/test/src/summary/top_level_inference_test.dart
index d78fbd0..dfe5949 100644
--- a/pkg/analyzer/test/src/summary/top_level_inference_test.dart
+++ b/pkg/analyzer/test/src/summary/top_level_inference_test.dart
@@ -1246,7 +1246,7 @@
   }
 
   test_initializer_extractProperty_explicitlyTyped_differentLibraryCycle() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class C {
   int f = 0;
 }
@@ -1314,7 +1314,7 @@
   }
 
   test_initializer_extractProperty_explicitlyTyped_sameLibraryCycle() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'test.dart'; // just do make it part of the library cycle
 class C {
   int f = 0;
@@ -1344,7 +1344,7 @@
   }
 
   test_initializer_extractProperty_implicitlyTyped_differentLibraryCycle() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 class C {
   var f = 0;
 }
@@ -1412,7 +1412,7 @@
   }
 
   test_initializer_extractProperty_implicitlyTyped_sameLibraryCycle() async {
-    newFile2('$testPackageLibPath/a.dart', r'''
+    newFile('$testPackageLibPath/a.dart', r'''
 import 'test.dart'; // just do make it part of the library cycle
 class C {
   var f = 0;
@@ -5979,7 +5979,7 @@
   }
 
   test_method_OK_single_private_linkThroughOtherLibraryOfCycle() async {
-    newFile2('$testPackageLibPath/other.dart', r'''
+    newFile('$testPackageLibPath/other.dart', r'''
 import 'test.dart';
 class B extends A2 {}
 ''');
@@ -6163,7 +6163,7 @@
   }
 
   Future<LibraryElement> _encodeDecodeLibrary(String text) async {
-    newFile2(testFilePath, text);
+    newFile(testFilePath, text);
 
     var path = convertPath(testFilePath);
     var analysisSession = contextFor(path).currentSession;
diff --git a/pkg/analyzer/test/src/summary2/ast_text_printer_test.dart b/pkg/analyzer/test/src/summary2/ast_text_printer_test.dart
index cbdca46..f43ad14 100644
--- a/pkg/analyzer/test/src/summary2/ast_text_printer_test.dart
+++ b/pkg/analyzer/test/src/summary2/ast_text_printer_test.dart
@@ -25,7 +25,7 @@
   code = code.replaceAll('\r\n', '\n');
   code = code.replaceAll('\r', '\n');
 
-  var path = base.newFile2('/home/test/lib/test.dart', code).path;
+  var path = base.newFile('/home/test/lib/test.dart', code).path;
 
   ParseResult parseResult;
   try {
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index afb2f16..8e78316 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -248,7 +248,7 @@
   }
 
   test_conversionAndDynamicInvoke() async {
-    newFile2('$testPackageLibPath/helper.dart', r'''
+    newFile('$testPackageLibPath/helper.dart', r'''
 dynamic toString = (int x) => x + 42;
 dynamic hashCode = "hello";
 ''');
@@ -2787,7 +2787,7 @@
   }
 
   test_privateOverride() async {
-    newFile2('$testPackageLibPath/helper.dart', r'''
+    newFile('$testPackageLibPath/helper.dart', r'''
 import 'test.dart' as main;
 
 class Base {
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index e04aa1c..dedd656 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -2579,11 +2579,11 @@
   }
 
   test_inferConstsTransitively() async {
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 const b1 = 2;
 ''');
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'test.dart';
 import 'b.dart';
 const a1 = m2;
@@ -2740,7 +2740,7 @@
   }
 
   test_inferFromVariablesInCycleLibsWhenFlagIsOn() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'test.dart';
 var x = 2; // ok to infer
 ''');
@@ -2759,7 +2759,7 @@
   }
 
   test_inferFromVariablesInCycleLibsWhenFlagIsOn2() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'test.dart';
 class A { static var x = 2; }
 ''');
@@ -2778,7 +2778,7 @@
   }
 
   test_inferFromVariablesInNonCycleImportsWithFlag() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 var x = 2;
 ''');
 
@@ -2797,7 +2797,7 @@
   }
 
   test_inferFromVariablesInNonCycleImportsWithFlag2() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 class A { static var x = 2; }
 ''');
 
@@ -3352,11 +3352,11 @@
   }
 
   test_inferStaticsTransitively() async {
-    newFile2('$testPackageLibPath/b.dart', '''
+    newFile('$testPackageLibPath/b.dart', '''
 final b1 = 2;
 ''');
 
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'test.dart';
 import 'b.dart';
 final a1 = m2;
@@ -3396,7 +3396,7 @@
   }
 
   test_inferStaticsTransitively3() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 const a1 = 3;
 const a2 = 4;
 class A {
@@ -3426,7 +3426,7 @@
   }
 
   test_inferStaticsWithMethodInvocations() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 m3(String a, String b, [a1,a2]) {}
 ''');
 
@@ -3566,7 +3566,7 @@
   }
 
   test_inferTypeRegardlessOfDeclarationOrderOrCycles() async {
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'test.dart';
 
 class B extends A { }
@@ -3694,7 +3694,7 @@
 
   test_inferTypesOnGenericInstantiationsInLibraryCycle() async {
     // Note: this is a regression test for bug #48.
-    newFile2('$testPackageLibPath/a.dart', '''
+    newFile('$testPackageLibPath/a.dart', '''
 import 'test.dart';
 abstract class I<E> {
   A<E> m(a, String f(v, int e));
diff --git a/pkg/analyzer/test/src/workspace/basic_test.dart b/pkg/analyzer/test/src/workspace/basic_test.dart
index c239300..55d8b3d 100644
--- a/pkg/analyzer/test/src/workspace/basic_test.dart
+++ b/pkg/analyzer/test/src/workspace/basic_test.dart
@@ -32,7 +32,7 @@
   }
 
   void test_contains_differentWorkspace() {
-    newFile2('/workspace2/project/lib/file.dart', '');
+    newFile('/workspace2/project/lib/file.dart', '');
 
     var package = findPackage('/workspace/project/lib/code.dart')!;
     expect(
@@ -42,7 +42,7 @@
   }
 
   void test_contains_sameWorkspace() {
-    newFile2('/workspace/project/lib/file2.dart', '');
+    newFile('/workspace/project/lib/file2.dart', '');
 
     var package = findPackage('/workspace/project/lib/code.dart')!;
     expect(
@@ -60,7 +60,7 @@
   }
 
   void test_findPackageFor_includedFile() {
-    newFile2('/workspace/project/lib/file.dart', '');
+    newFile('/workspace/project/lib/file.dart', '');
 
     var package = findPackage('/workspace/project/lib/file.dart')!;
     expect(package, isNotNull);
@@ -69,7 +69,7 @@
   }
 
   void test_findPackageFor_unrelatedFile() {
-    newFile2('/workspace/project/lib/file.dart', '');
+    newFile('/workspace/project/lib/file.dart', '');
 
     var package = findPackage('/workspace2/project/lib/file.dart');
     expect(package, isNull);
diff --git a/pkg/analyzer/test/src/workspace/bazel_test.dart b/pkg/analyzer/test/src/workspace/bazel_test.dart
index 72f96f4..34b86ec 100644
--- a/pkg/analyzer/test/src/workspace/bazel_test.dart
+++ b/pkg/analyzer/test/src/workspace/bazel_test.dart
@@ -154,7 +154,7 @@
       if (path.endsWith('/')) {
         newFolder(path.substring(0, path.length - 1));
       } else {
-        newFile2(path, '');
+        newFile(path, '');
       }
     }
     workspace = BazelWorkspace.find(
@@ -648,7 +648,7 @@
       if (path.endsWith('/')) {
         newFolder(path.substring(0, path.length - 1));
       } else {
-        newFile2(path, '');
+        newFile(path, '');
       }
     }
     workspace =
@@ -718,10 +718,10 @@
 
   void test_contains_samePackage() {
     _setUpPackage();
-    final targetFile = newFile2('/ws/some/code/lib/code2.dart', '');
-    final targetFile2 = newFile2('/ws/some/code/lib/src/code3.dart', '');
-    final targetBinFile = newFile2('/ws/some/code/bin/code.dart', '');
-    final targetTestFile = newFile2('/ws/some/code/test/code_test.dart', '');
+    final targetFile = newFile('/ws/some/code/lib/code2.dart', '');
+    final targetFile2 = newFile('/ws/some/code/lib/src/code3.dart', '');
+    final targetBinFile = newFile('/ws/some/code/bin/code.dart', '');
+    final targetTestFile = newFile('/ws/some/code/test/code_test.dart', '');
 
     expect(package!.contains(_testSource(targetFile.path)), isTrue);
     expect(package!.contains(_testSource(targetFile2.path)), isTrue);
@@ -731,8 +731,8 @@
 
   void test_contains_samePackage_summarySource() {
     _setUpPackage();
-    newFile2('/ws/some/code/lib/code2.dart', '');
-    newFile2('/ws/some/code/lib/src/code3.dart', '');
+    newFile('/ws/some/code/lib/code2.dart', '');
+    newFile('/ws/some/code/lib/src/code3.dart', '');
     final file2Source = _inSummarySource('package:some.code/code2.dart');
     final file3Source = _inSummarySource('package:some.code/src/code2.dart');
 
@@ -742,8 +742,8 @@
 
   void test_contains_subPackage() {
     _setUpPackage();
-    newFile2('/ws/some/code/testing/BUILD', '');
-    newFile2('/ws/some/code/testing/lib/testing.dart', '');
+    newFile('/ws/some/code/testing/BUILD', '');
+    newFile('/ws/some/code/testing/lib/testing.dart', '');
 
     expect(
       package!.contains(
@@ -784,8 +784,8 @@
   void test_findPackageFor_inBlazeOut_notPackage() {
     var path =
         convertPath('/ws/blaze-out/k8-opt/bin/news/lib/news_base.pb.dart');
-    newFile2('/ws/news/BUILD', '');
-    newFile2(path, '');
+    newFile('/ws/news/BUILD', '');
+    newFile(path, '');
     workspace = BazelWorkspace.find(resourceProvider, path)!;
 
     var package = workspace.findPackageFor(path);
@@ -801,7 +801,7 @@
       resourceProvider,
       convertPath('/ws/some/code'),
     )!;
-    final targetFile = newFile2('/ws/some/code/lib/code.dart', '');
+    final targetFile = newFile('/ws/some/code/lib/code.dart', '');
 
     package = workspace.findPackageFor(targetFile.path);
     expect(package, isNull);
@@ -894,7 +894,7 @@
       if (path.endsWith('/')) {
         newFolder(path.substring(0, path.length - 1));
       } else {
-        newFile2(path, '');
+        newFile(path, '');
       }
     }
   }
@@ -1138,7 +1138,7 @@
 
   void test_find_null_symlinkPrefix() {
     String prefix = BazelWorkspace.defaultSymlinkPrefix;
-    newFile2('/workspace/WORKSPACE', '');
+    newFile('/workspace/WORKSPACE', '');
     var workspace = BazelWorkspace.find(
         resourceProvider, convertPath('/workspace/my/module'))!;
     expect(workspace.root, convertPath('/workspace'));
@@ -1209,7 +1209,7 @@
       if (path.endsWith('/')) {
         newFolder(path.substring(0, path.length - 1));
       } else {
-        newFile2(path, '');
+        newFile(path, '');
       }
     }
   }
diff --git a/pkg/analyzer/test/src/workspace/bazel_watcher_test.dart b/pkg/analyzer/test/src/workspace/bazel_watcher_test.dart
index e33dd39..647a228 100644
--- a/pkg/analyzer/test/src/workspace/bazel_watcher_test.dart
+++ b/pkg/analyzer/test/src/workspace/bazel_watcher_test.dart
@@ -281,7 +281,7 @@
       if (path.endsWith('/')) {
         newFolder(path.substring(0, path.length - 1));
       } else {
-        newFile2(path, '');
+        newFile(path, '');
       }
     }
   }
diff --git a/pkg/analyzer/test/src/workspace/gn_test.dart b/pkg/analyzer/test/src/workspace/gn_test.dart
index 4b041cb..9f697a5 100644
--- a/pkg/analyzer/test/src/workspace/gn_test.dart
+++ b/pkg/analyzer/test/src/workspace/gn_test.dart
@@ -20,8 +20,8 @@
 class GnWorkspacePackageTest with ResourceProviderMixin {
   void test_contains_differentPackageInWorkspace() {
     GnWorkspace workspace = _buildStandardGnWorkspace();
-    newFile2('/ws/some/code/BUILD.gn', '');
-    var targetFile = newFile2('/ws/some/code/lib/code.dart', '');
+    newFile('/ws/some/code/BUILD.gn', '');
+    var targetFile = newFile('/ws/some/code/lib/code.dart', '');
 
     var package = workspace.findPackageFor(targetFile.path)!;
     // A file that is _not_ in this package is not required to have a BUILD.gn
@@ -34,8 +34,8 @@
 
   void test_contains_differentWorkspace() {
     GnWorkspace workspace = _buildStandardGnWorkspace();
-    newFile2('/ws/some/code/BUILD.gn', '');
-    var targetFile = newFile2('/ws/some/code/lib/code.dart', '');
+    newFile('/ws/some/code/BUILD.gn', '');
+    var targetFile = newFile('/ws/some/code/lib/code.dart', '');
 
     var package = workspace.findPackageFor(targetFile.path)!;
     expect(package.contains(TestSource(convertPath('/ws2/some/file.dart'))),
@@ -44,12 +44,12 @@
 
   void test_contains_samePackage() {
     GnWorkspace workspace = _buildStandardGnWorkspace();
-    newFile2('/ws/some/code/BUILD.gn', '');
-    var targetFile = newFile2('/ws/some/code/lib/code.dart', '');
-    var targetFile2 = newFile2('/ws/some/code/lib/code2.dart', '');
-    var targetFile3 = newFile2('/ws/some/code/lib/src/code3.dart', '');
-    var targetBinFile = newFile2('/ws/some/code/bin/code.dart', '');
-    var targetTestFile = newFile2('/ws/some/code/test/code_test.dart', '');
+    newFile('/ws/some/code/BUILD.gn', '');
+    var targetFile = newFile('/ws/some/code/lib/code.dart', '');
+    var targetFile2 = newFile('/ws/some/code/lib/code2.dart', '');
+    var targetFile3 = newFile('/ws/some/code/lib/src/code3.dart', '');
+    var targetBinFile = newFile('/ws/some/code/bin/code.dart', '');
+    var targetTestFile = newFile('/ws/some/code/test/code_test.dart', '');
 
     var package = workspace.findPackageFor(targetFile.path)!;
     expect(package.contains(TestSource(targetFile2.path)), isTrue);
@@ -60,10 +60,10 @@
 
   void test_contains_subPackage() {
     GnWorkspace workspace = _buildStandardGnWorkspace();
-    newFile2('/ws/some/code/BUILD.gn', '');
-    newFile2('/ws/some/code/lib/code.dart', '');
-    newFile2('/ws/some/code/testing/BUILD.gn', '');
-    newFile2('/ws/some/code/testing/lib/testing.dart', '');
+    newFile('/ws/some/code/BUILD.gn', '');
+    newFile('/ws/some/code/lib/code.dart', '');
+    newFile('/ws/some/code/testing/BUILD.gn', '');
+    newFile('/ws/some/code/testing/lib/testing.dart', '');
 
     var package =
         workspace.findPackageFor(convertPath('/ws/some/code/lib/code.dart'))!;
@@ -75,8 +75,8 @@
 
   void test_findPackageFor_buildFileExists() {
     GnWorkspace workspace = _buildStandardGnWorkspace();
-    newFile2('/ws/some/code/BUILD.gn', '');
-    var targetFile = newFile2('/ws/some/code/lib/code.dart', '');
+    newFile('/ws/some/code/BUILD.gn', '');
+    var targetFile = newFile('/ws/some/code/lib/code.dart', '');
 
     var package = workspace.findPackageFor(targetFile.path)!;
     expect(package.root, convertPath('/ws/some/code'));
@@ -85,7 +85,7 @@
 
   void test_findPackageFor_missingBuildFile() {
     GnWorkspace workspace = _buildStandardGnWorkspace();
-    newFile2('/ws/some/code/lib/code.dart', '');
+    newFile('/ws/some/code/lib/code.dart', '');
 
     var package =
         workspace.findPackageFor(convertPath('/ws/some/code/lib/code.dart'));
@@ -94,8 +94,8 @@
 
   void test_packagesAvailableTo() {
     GnWorkspace workspace = _buildStandardGnWorkspace();
-    newFile2('/ws/some/code/BUILD.gn', '');
-    var libraryPath = newFile2('/ws/some/code/lib/code.dart', '').path;
+    newFile('/ws/some/code/BUILD.gn', '');
+    var libraryPath = newFile('/ws/some/code/lib/code.dart', '').path;
     var package = workspace.findPackageFor(libraryPath)!;
     var packageMap = package.packagesAvailableTo(libraryPath);
     expect(packageMap.keys, unorderedEquals(['p1', 'workspace']));
@@ -104,8 +104,8 @@
   GnWorkspace _buildStandardGnWorkspace() {
     newFolder('/ws/.jiri_root');
     String buildDir = convertPath('out/debug-x87_128');
-    newFile2('/ws/.fx-build-dir', '$buildDir\n');
-    newFile2(
+    newFile('/ws/.fx-build-dir', '$buildDir\n');
+    newFile(
         '/ws/out/debug-x87_128/dartlang/gen/some/code/foo_package_config.json',
         '''{
   "configVersion": 2,
@@ -160,8 +160,8 @@
     newFolder('/workspace/some/code');
     newPubspecYamlFile('/workspace/some/code', '');
     String buildDir = convertPath('out/debug-x87_128');
-    newFile2('/workspace/.fx-build-dir', '$buildDir\n');
-    newFile2(
+    newFile('/workspace/.fx-build-dir', '$buildDir\n');
+    newFile(
       '/workspace/out/debug-x87_128/dartlang/gen/some/code/foo_package_config.json',
       '',
     );
@@ -175,10 +175,10 @@
     newFolder('/workspace/some/code');
     newPubspecYamlFile('/workspace/some/code', '');
     String buildDir = convertPath('out/debug-x87_128');
-    newFile2('/workspace/.fx-build-dir', '$buildDir\n');
+    newFile('/workspace/.fx-build-dir', '$buildDir\n');
     String packageLocation = convertPath('/workspace/this/is/the/package');
     Uri packageUri = resourceProvider.pathContext.toUri(packageLocation);
-    newFile2(
+    newFile(
         '/workspace/out/debug-x87_128/dartlang/gen/some/code/foo_package_config.json',
         '''{
   "configVersion": 2,
@@ -204,10 +204,10 @@
     newFolder('/workspace/some/code');
     newPubspecYamlFile('/workspace/some/code', '');
     String buildDir = convertPath('/workspace/out/debug-x87_128');
-    newFile2('/workspace/.fx-build-dir', '$buildDir\n');
+    newFile('/workspace/.fx-build-dir', '$buildDir\n');
     String packageLocation = convertPath('/workspace/this/is/the/package');
     Uri packageUri = resourceProvider.pathContext.toUri(packageLocation);
-    newFile2(
+    newFile(
         '/workspace/out/debug-x87_128/dartlang/gen/some/code/foo_package_config.json',
         '''{
   "configVersion": 2,
@@ -234,7 +234,7 @@
     newPubspecYamlFile('/workspace/some/code', '');
     String packageLocation = convertPath('/workspace/this/is/the/package');
     Uri packageUri = resourceProvider.pathContext.toUri(packageLocation);
-    newFile2(
+    newFile(
         '/workspace/out/debug-x87_128/dartlang/gen/some/code/foo_package_config.json',
         '''{
   "configVersion": 2,
@@ -259,10 +259,10 @@
     newFolder('/workspace/.jiri_root');
     newFolder('/workspace/some/code');
     newPubspecYamlFile('/workspace/some/code', '');
-    newFile2('/workspace/.fx-build-dir', '');
+    newFile('/workspace/.fx-build-dir', '');
     String packageLocation = convertPath('/workspace/this/is/the/package');
     Uri packageUri = resourceProvider.pathContext.toUri(packageLocation);
-    newFile2(
+    newFile(
         '/workspace/out/debug-x87_128/dartlang/gen/some/code/foo_package_config.json',
         '''{
   "configVersion": 2,
@@ -288,10 +288,10 @@
     newFolder('/workspace/some/code');
     newPubspecYamlFile('/workspace/some/code', '');
     String buildDir = convertPath('out/release-y22_256');
-    newFile2('/workspace/.fx-build-dir', '$buildDir\n');
+    newFile('/workspace/.fx-build-dir', '$buildDir\n');
     String packageLocation = convertPath('/workspace/this/is/the/package');
     Uri packageUri = resourceProvider.pathContext.toUri(packageLocation);
-    newFile2(
+    newFile(
         '/workspace/out/debug-x87_128/dartlang/gen/some/code/foo_package_config.json',
         '''{
   "configVersion": 2,
@@ -307,7 +307,7 @@
     String otherPackageLocation = convertPath('/workspace/here/too');
     Uri otherPackageUri =
         resourceProvider.pathContext.toUri(otherPackageLocation);
-    newFile2(
+    newFile(
         '/workspace/out/release-y22_256/dartlang/gen/some/code/foo_package_config.json',
         '''{
   "configVersion": 2,
@@ -333,10 +333,10 @@
     newFolder('/workspace/some/code');
     newPubspecYamlFile('/workspace/some/code', '');
     String buildDir = convertPath('out/debug-x87_128');
-    newFile2('/workspace/.fx-build-dir', '$buildDir\n');
+    newFile('/workspace/.fx-build-dir', '$buildDir\n');
     String packageOneLocation = convertPath('/workspace/this/is/the/package');
     Uri packageOneUri = resourceProvider.pathContext.toUri(packageOneLocation);
-    newFile2(
+    newFile(
         '/workspace/out/debug-x87_128/dartlang/gen/some/code/foo_package_config.json',
         '''{
   "configVersion": 2,
@@ -352,7 +352,7 @@
     String packageTwoLocation =
         convertPath('/workspace/this/is/the/other/package');
     Uri packageTwoUri = resourceProvider.pathContext.toUri(packageTwoLocation);
-    newFile2(
+    newFile(
         '/workspace/out/debug-x87_128/dartlang/gen/some/code/foo_test_package_config.json',
         '''{
   "configVersion": 2,
diff --git a/pkg/analyzer/test/src/workspace/package_build_test.dart b/pkg/analyzer/test/src/workspace/package_build_test.dart
index 534e9de..43fde355 100644
--- a/pkg/analyzer/test/src/workspace/package_build_test.dart
+++ b/pkg/analyzer/test/src/workspace/package_build_test.dart
@@ -58,8 +58,8 @@
       convertPath('/workspace'),
     )!;
     resolver = PackageBuildFileUriResolver(workspace);
-    newFile2('/workspace/test.dart', '');
-    newFile2('/workspace/.dart_tool/build/generated/project/gen.dart', '');
+    newFile('/workspace/test.dart', '');
+    newFile('/workspace/.dart_tool/build/generated/project/gen.dart', '');
     expect(workspace.isBazel, isFalse);
   }
 
@@ -121,7 +121,7 @@
   Uri addPackageSource(String path, String uriStr, {bool create = true}) {
     Uri uri = Uri.parse(uriStr);
     final file = create
-        ? newFile2(path, '')
+        ? newFile(path, '')
         : resourceProvider.getResource(convertPath(path)) as File;
     packageUriResolver.add(uri, file);
     return uri;
@@ -186,7 +186,7 @@
       if (path.endsWith('/')) {
         newFolder(path.substring(0, path.length - 1));
       } else {
-        newFile2(path, '');
+        newFile(path, '');
       }
     }
     workspace = PackageBuildWorkspace.find(
@@ -268,10 +268,10 @@
 
   test_contains_fileUri_generated() {
     var myGeneratedPath = '$myPackageGeneratedPath/my/test/a.dart';
-    newFile2(myGeneratedPath, '');
+    newFile(myGeneratedPath, '');
 
     var fooGeneratedPath = '$myPackageGeneratedPath/foo/test/a.dart';
-    newFile2(fooGeneratedPath, '');
+    newFile(fooGeneratedPath, '');
 
     expect(
       myPackage.contains(
@@ -386,7 +386,7 @@
     PackageBuildWorkspace workspace =
         _createWorkspace('/workspace', ['project']);
 
-    final libFile = newFile2(
+    final libFile = newFile(
         '/workspace/.dart_tool/build/generated/project/lib/file.dart', '');
     expect(
         workspace.builtFile(convertPath('lib/file.dart'), 'project'), libFile);
@@ -399,7 +399,7 @@
         _createWorkspace('/workspace', ['project', 'foo']);
 
     final libFile =
-        newFile2('/workspace/.dart_tool/build/generated/foo/lib/file.dart', '');
+        newFile('/workspace/.dart_tool/build/generated/foo/lib/file.dart', '');
     expect(workspace.builtFile(convertPath('lib/file.dart'), 'foo'), libFile);
   }
 
@@ -412,7 +412,7 @@
         _createWorkspace('/workspace', ['project', 'foo']);
 
     // Create a generated file in package:bar.
-    newFile2('/workspace/.dart_tool/build/generated/bar/lib/file.dart', '');
+    newFile('/workspace/.dart_tool/build/generated/bar/lib/file.dart', '');
 
     // Bar not in packages, file should not be returned.
     expect(workspace.builtFile('lib/file.dart', 'bar'), isNull);
@@ -561,7 +561,7 @@
     PackageBuildWorkspace workspace =
         _createWorkspace('/workspace', ['project']);
 
-    final binFile = newFile2('/workspace/bin/file.dart', '');
+    final binFile = newFile('/workspace/bin/file.dart', '');
     expect(
         workspace.findFile(convertPath('/workspace/bin/file.dart')), binFile);
   }
@@ -572,7 +572,7 @@
     PackageBuildWorkspace workspace =
         _createWorkspace('/workspace', ['project']);
 
-    final binFile = newFile2(
+    final binFile = newFile(
         '/workspace/.dart_tool/build/generated/project/bin/file.dart', '');
     expect(
         workspace.findFile(convertPath('/workspace/bin/file.dart')), binFile);
@@ -584,7 +584,7 @@
     PackageBuildWorkspace workspace =
         _createWorkspace('/workspace', ['project']);
 
-    final libFile = newFile2(
+    final libFile = newFile(
         '/workspace/.dart_tool/build/generated/project/lib/file.dart', '');
     expect(
         workspace.findFile(convertPath('/workspace/lib/file.dart')), libFile);
@@ -596,7 +596,7 @@
     PackageBuildWorkspace workspace =
         _createWorkspace('/workspace', ['project']);
 
-    final testFile = newFile2('/workspace/test/file.dart', '');
+    final testFile = newFile('/workspace/test/file.dart', '');
     expect(
         workspace.findFile(convertPath('/workspace/test/file.dart')), testFile);
   }
@@ -607,7 +607,7 @@
     PackageBuildWorkspace workspace =
         _createWorkspace('/workspace', ['project']);
 
-    final testFile = newFile2(
+    final testFile = newFile(
         '/workspace/.dart_tool/build/generated/project/test/file.dart', '');
     expect(
         workspace.findFile(convertPath('/workspace/test/file.dart')), testFile);
@@ -619,7 +619,7 @@
     PackageBuildWorkspace workspace =
         _createWorkspace('/workspace', ['project']);
 
-    final webFile = newFile2('/workspace/web/file.dart', '');
+    final webFile = newFile('/workspace/web/file.dart', '');
     expect(
         workspace.findFile(convertPath('/workspace/web/file.dart')), webFile);
   }
@@ -630,7 +630,7 @@
     PackageBuildWorkspace workspace =
         _createWorkspace('/workspace', ['project']);
 
-    final webFile = newFile2(
+    final webFile = newFile(
         '/workspace/.dart_tool/build/generated/project/web/file.dart', '');
     expect(
         workspace.findFile(convertPath('/workspace/web/file.dart')), webFile);
diff --git a/pkg/analyzer/test/src/workspace/pub_test.dart b/pkg/analyzer/test/src/workspace/pub_test.dart
index b9ccd89..0dcc810 100644
--- a/pkg/analyzer/test/src/workspace/pub_test.dart
+++ b/pkg/analyzer/test/src/workspace/pub_test.dart
@@ -32,7 +32,7 @@
   }
 
   void test_contains_differentWorkspace() {
-    newFile2('/workspace2/project/lib/file.dart', '');
+    newFile('/workspace2/project/lib/file.dart', '');
 
     var package = findPackage('/workspace/project/lib/code.dart')!;
     expect(
@@ -42,7 +42,7 @@
   }
 
   void test_contains_sameWorkspace() {
-    newFile2('/workspace/project/lib/file2.dart', '');
+    newFile('/workspace/project/lib/file2.dart', '');
 
     var package = findPackage('/workspace/project/lib/code.dart')!;
     expect(
@@ -60,7 +60,7 @@
   }
 
   void test_findPackageFor_includedFile() {
-    newFile2('/workspace/project/lib/file.dart', '');
+    newFile('/workspace/project/lib/file.dart', '');
 
     var package = findPackage('/workspace/project/lib/file.dart')!;
     expect(package.root, convertPath('/workspace'));
@@ -68,7 +68,7 @@
   }
 
   void test_findPackageFor_unrelatedFile() {
-    newFile2('/workspace/project/lib/file.dart', '');
+    newFile('/workspace/project/lib/file.dart', '');
 
     var package = findPackage('/workspace2/project/lib/file.dart');
     expect(package, isNull);
diff --git a/pkg/analyzer/test/verify_diagnostics_test.dart b/pkg/analyzer/test/verify_diagnostics_test.dart
index f72877b..1e6507b 100644
--- a/pkg/analyzer/test/verify_diagnostics_test.dart
+++ b/pkg/analyzer/test/verify_diagnostics_test.dart
@@ -443,12 +443,12 @@
         packageConfigBuilder.add(name: packageName, rootPath: packageRootPath);
 
         String pathInLib = uri.pathSegments.skip(1).join('/');
-        newFile2(
+        newFile(
           '$packageRootPath/lib/$pathInLib',
           auxiliaryFiles[uriStr]!,
         );
       } else {
-        newFile2(
+        newFile(
           '$testPackageRootPath/$uriStr',
           auxiliaryFiles[uriStr]!,
         );
diff --git a/pkg/analyzer_plugin/test/plugin/assist_mixin_test.dart b/pkg/analyzer_plugin/test/plugin/assist_mixin_test.dart
index 924e293..475a6552 100644
--- a/pkg/analyzer_plugin/test/plugin/assist_mixin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/assist_mixin_test.dart
@@ -30,7 +30,7 @@
   void setUp() {
     packagePath1 = convertPath('/package1');
     filePath1 = join(packagePath1, 'lib', 'test.dart');
-    newFile2(filePath1, '');
+    newFile(filePath1, '');
     contextRoot1 = ContextRoot(packagePath1, <String>[]);
 
     channel = MockChannel();
diff --git a/pkg/analyzer_plugin/test/plugin/completion_mixin_test.dart b/pkg/analyzer_plugin/test/plugin/completion_mixin_test.dart
index 73d620a..ad201a7 100644
--- a/pkg/analyzer_plugin/test/plugin/completion_mixin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/completion_mixin_test.dart
@@ -30,7 +30,7 @@
   void setUp() {
     packagePath1 = convertPath('/package1');
     filePath1 = join(packagePath1, 'lib', 'test.dart');
-    newFile2(filePath1, 'int foo = bar;');
+    newFile(filePath1, 'int foo = bar;');
     contextRoot1 = ContextRoot(packagePath1, <String>[]);
 
     channel = MockChannel();
diff --git a/pkg/analyzer_plugin/test/plugin/fix_mixin_test.dart b/pkg/analyzer_plugin/test/plugin/fix_mixin_test.dart
index 192d701..34b456d 100644
--- a/pkg/analyzer_plugin/test/plugin/fix_mixin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/fix_mixin_test.dart
@@ -34,7 +34,7 @@
   void setUp() {
     packagePath1 = convertPath('/package1');
     filePath1 = join(packagePath1, 'lib', 'test.dart');
-    newFile2(filePath1, '');
+    newFile(filePath1, '');
     contextRoot1 = ContextRoot(packagePath1, <String>[]);
 
     channel = MockChannel();
diff --git a/pkg/analyzer_plugin/test/plugin/folding_mixin_test.dart b/pkg/analyzer_plugin/test/plugin/folding_mixin_test.dart
index 795ec0f..c1986c4 100644
--- a/pkg/analyzer_plugin/test/plugin/folding_mixin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/folding_mixin_test.dart
@@ -33,7 +33,7 @@
   void setUp() {
     packagePath1 = convertPath('/package1');
     filePath1 = join(packagePath1, 'lib', 'test.dart');
-    newFile2(filePath1, '');
+    newFile(filePath1, '');
     contextRoot1 = ContextRoot(packagePath1, <String>[]);
 
     channel = MockChannel();
diff --git a/pkg/analyzer_plugin/test/plugin/highlights_mixin_test.dart b/pkg/analyzer_plugin/test/plugin/highlights_mixin_test.dart
index 45a1964..409eafa 100644
--- a/pkg/analyzer_plugin/test/plugin/highlights_mixin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/highlights_mixin_test.dart
@@ -33,7 +33,7 @@
   void setUp() {
     packagePath1 = convertPath('/package1');
     filePath1 = join(packagePath1, 'lib', 'test.dart');
-    newFile2(filePath1, '');
+    newFile(filePath1, '');
     contextRoot1 = ContextRoot(packagePath1, <String>[]);
 
     channel = MockChannel();
diff --git a/pkg/analyzer_plugin/test/plugin/kythe_mixin_test.dart b/pkg/analyzer_plugin/test/plugin/kythe_mixin_test.dart
index 743cf17..e038fe0 100644
--- a/pkg/analyzer_plugin/test/plugin/kythe_mixin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/kythe_mixin_test.dart
@@ -30,7 +30,7 @@
   void setUp() {
     packagePath1 = convertPath('/package1');
     filePath1 = join(packagePath1, 'lib', 'test.dart');
-    newFile2(filePath1, '');
+    newFile(filePath1, '');
     contextRoot1 = ContextRoot(packagePath1, <String>[]);
 
     channel = MockChannel();
diff --git a/pkg/analyzer_plugin/test/plugin/navigation_mixin_test.dart b/pkg/analyzer_plugin/test/plugin/navigation_mixin_test.dart
index 9934550..38cb85a 100644
--- a/pkg/analyzer_plugin/test/plugin/navigation_mixin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/navigation_mixin_test.dart
@@ -33,7 +33,7 @@
   void setUp() {
     packagePath1 = convertPath('/package1');
     filePath1 = join(packagePath1, 'lib', 'test.dart');
-    newFile2(filePath1, '');
+    newFile(filePath1, '');
     contextRoot1 = ContextRoot(packagePath1, <String>[]);
 
     channel = MockChannel();
diff --git a/pkg/analyzer_plugin/test/plugin/occurrences_mixin_test.dart b/pkg/analyzer_plugin/test/plugin/occurrences_mixin_test.dart
index 88f4153..fa1aec6 100644
--- a/pkg/analyzer_plugin/test/plugin/occurrences_mixin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/occurrences_mixin_test.dart
@@ -33,7 +33,7 @@
   void setUp() {
     packagePath1 = convertPath('/package1');
     filePath1 = join(packagePath1, 'lib', 'test.dart');
-    newFile2(filePath1, '');
+    newFile(filePath1, '');
     contextRoot1 = ContextRoot(packagePath1, <String>[]);
 
     channel = MockChannel();
diff --git a/pkg/analyzer_plugin/test/plugin/outline_mixin_test.dart b/pkg/analyzer_plugin/test/plugin/outline_mixin_test.dart
index 5d2933c..1b4ff4e 100644
--- a/pkg/analyzer_plugin/test/plugin/outline_mixin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/outline_mixin_test.dart
@@ -33,7 +33,7 @@
   void setUp() {
     packagePath1 = convertPath('/package1');
     filePath1 = join(packagePath1, 'lib', 'test.dart');
-    newFile2(filePath1, '');
+    newFile(filePath1, '');
     contextRoot1 = ContextRoot(packagePath1, <String>[]);
 
     channel = MockChannel();
diff --git a/pkg/analyzer_plugin/test/plugin/plugin_test.dart b/pkg/analyzer_plugin/test/plugin/plugin_test.dart
index edbddc7..a221850 100644
--- a/pkg/analyzer_plugin/test/plugin/plugin_test.dart
+++ b/pkg/analyzer_plugin/test/plugin/plugin_test.dart
@@ -33,12 +33,12 @@
   void setUp() {
     packagePath1 = convertPath('/package1');
     filePath1 = join(packagePath1, 'lib', 'test.dart');
-    newFile2(filePath1, '');
+    newFile(filePath1, '');
     contextRoot1 = ContextRoot(packagePath1, <String>[]);
 
     packagePath2 = convertPath('/package2');
     filePath2 = join(packagePath2, 'lib', 'test.dart');
-    newFile2(filePath2, '');
+    newFile(filePath2, '');
     contextRoot2 = ContextRoot(packagePath2, <String>[]);
 
     channel = MockChannel();
diff --git a/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart b/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart
index fd6eb9b..4d9d8e9 100644
--- a/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart
+++ b/pkg/analyzer_plugin/test/src/utilities/change_builder/change_builder_dart_test.dart
@@ -1837,7 +1837,7 @@
 }
 ''';
     var path = convertPath('/home/test/lib/test.dart');
-    newFile2(path, initialCode);
+    newFile(path, initialCode);
 
     var builder = await newBuilder();
     await builder.addDartFileEdit(path, (builder) {
@@ -1889,7 +1889,7 @@
 }
 ''';
     var path = convertPath('/home/test/lib/test.dart');
-    newFile2(path, initialCode);
+    newFile(path, initialCode);
 
     var builder = await newBuilder();
     await builder.addDartFileEdit(path, (builder) {
@@ -1918,7 +1918,7 @@
   Future<void> test_multipleEdits_concurrently() async {
     var initialCode = '00';
     var path = convertPath('/home/test/lib/test.dart');
-    newFile2(path, initialCode);
+    newFile(path, initialCode);
 
     var builder = await newBuilder();
     var future = Future.wait([
@@ -1936,7 +1936,7 @@
   Future<void> test_multipleEdits_sequentially() async {
     var initialCode = '00';
     var path = convertPath('/home/test/lib/test.dart');
-    newFile2(path, initialCode);
+    newFile(path, initialCode);
 
     var builder = await newBuilder();
     await builder.addDartFileEdit(path, (builder) {
diff --git a/pkg/analyzer_plugin/test/src/utilities/change_builder/dart/import_library_element_test.dart b/pkg/analyzer_plugin/test/src/utilities/change_builder/dart/import_library_element_test.dart
index 351257e..7a9aef8 100644
--- a/pkg/analyzer_plugin/test/src/utilities/change_builder/dart/import_library_element_test.dart
+++ b/pkg/analyzer_plugin/test/src/utilities/change_builder/dart/import_library_element_test.dart
@@ -44,7 +44,7 @@
   }
 
   Future<void> test_withoutPrefix() async {
-    newFile2('/home/test/lib/a.dart', 'class A {}');
+    newFile('/home/test/lib/a.dart', 'class A {}');
 
     await _assertImportLibraryElement(
       initialCode: r'''
@@ -56,8 +56,8 @@
   }
 
   Future<void> test_withoutPrefix_exported() async {
-    newFile2('/home/test/lib/a.dart', 'class A {}');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/a.dart', 'class A {}');
+    newFile('/home/test/lib/b.dart', r'''
 export 'a.dart';
 ''');
     await _assertImportLibraryElement(
@@ -70,7 +70,7 @@
   }
 
   Future<void> test_withoutPrefix_hasInvalidImport() async {
-    newFile2('/home/test/lib/a.dart', 'class A {}');
+    newFile('/home/test/lib/a.dart', 'class A {}');
 
     await _assertImportLibraryElement(
       initialCode: r'''
@@ -83,10 +83,10 @@
   }
 
   Future<void> test_withoutPrefix_referencedNames_sameElements() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 ''');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/b.dart', r'''
 export 'a.dart';
 
 class B {}
@@ -104,8 +104,8 @@
   }
 
   Future<void> test_withoutPrefix_twoImports_sameElement() async {
-    newFile2('/home/test/lib/a.dart', 'class C {}');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/a.dart', 'class C {}');
+    newFile('/home/test/lib/b.dart', r'''
 export 'package:test/a.dart';
 ''');
 
@@ -129,7 +129,7 @@
   }
 
   Future<void> test_withPrefix() async {
-    newFile2('/home/test/lib/a.dart', 'class A {}');
+    newFile('/home/test/lib/a.dart', 'class A {}');
 
     await _assertImportLibraryElement(
       initialCode: r'''
@@ -142,8 +142,8 @@
   }
 
   Future<void> test_withPrefix_twoImports_sameElement() async {
-    newFile2('/home/test/lib/a.dart', 'class C {}');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/a.dart', 'class C {}');
+    newFile('/home/test/lib/b.dart', r'''
 export 'package:test/a.dart';
 ''');
 
@@ -172,10 +172,10 @@
 @reflectiveTest
 class ImportLibraryElement_newImport_withoutPrefix_Test extends _Base {
   Future<void> test_constructorName_name() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 int foo;
 ''');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/b.dart', r'''
 class B {
   B.foo();
 }
@@ -202,8 +202,8 @@
   }
 
   Future<void> test_exported() async {
-    newFile2('/home/test/lib/a.dart', 'class A {}');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/a.dart', 'class A {}');
+    newFile('/home/test/lib/b.dart', r'''
 export 'a.dart';
 ''');
     await _assertImportLibraryElement(
@@ -217,8 +217,8 @@
   }
 
   Future<void> test_exported_differentUri() async {
-    newFile2('/home/test/lib/a.dart', 'class A {}');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/a.dart', 'class A {}');
+    newFile('/home/test/lib/b.dart', r'''
 export 'a.dart';
 ''');
     await _assertImportLibraryElement(
@@ -235,10 +235,10 @@
   }
 
   Future<void> test_methodInvocation_name() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 int foo;
 ''');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/b.dart', r'''
 class B {
   static void foo() {}
 }
@@ -265,11 +265,11 @@
   }
 
   Future<void> test_noConflict_otherImport_hide() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 class B {}
 ''');
-    newFile2('/home/test/lib/b.dart', 'class B {}');
+    newFile('/home/test/lib/b.dart', 'class B {}');
     await _assertImportLibraryElement(
       initialCode: r'''
 import 'package:test/a.dart' hide B;
@@ -284,11 +284,11 @@
   }
 
   Future<void> test_noConflict_otherImport_show() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 class B {}
 ''');
-    newFile2('/home/test/lib/b.dart', 'class B {}');
+    newFile('/home/test/lib/b.dart', 'class B {}');
     await _assertImportLibraryElement(
       initialCode: r'''
 import 'package:test/a.dart' show A;
@@ -303,7 +303,7 @@
   }
 
   Future<void> test_noShadow_syntacticScope_localVariable() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 var foo = 0;
 ''');
     await _assertImportLibraryElement(
@@ -335,7 +335,7 @@
   }
 
   Future<void> test_noShadow_syntacticScope_typeParameter() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 class A {}
 ''');
     await _assertImportLibraryElement(
@@ -357,10 +357,10 @@
   }
 
   Future<void> test_prefixedIdentifier_identifier() async {
-    newFile2('/home/test/lib/a.dart', r'''
+    newFile('/home/test/lib/a.dart', r'''
 int foo;
 ''');
-    newFile2('/home/test/lib/b.dart', r'''
+    newFile('/home/test/lib/b.dart', r'''
 class B {
   static int foo;
 }
@@ -387,7 +387,7 @@
   }
 
   Future<void> test_thisName_notShadowed_localVariable_otherFunction() async {
-    newFile2('/home/test/lib/a.dart', 'int foo = 0;');
+    newFile('/home/test/lib/a.dart', 'int foo = 0;');
     await _assertImportLibraryElement(
       initialCode: r'''
 void f() {
@@ -415,8 +415,8 @@
   }
 
   Future<void> test_unrelated() async {
-    newFile2('/home/test/lib/a.dart', 'class A {}');
-    newFile2('/home/test/lib/b.dart', 'class B {}');
+    newFile('/home/test/lib/a.dart', 'class A {}');
+    newFile('/home/test/lib/b.dart', 'class B {}');
     await _assertImportLibraryElement(
       initialCode: r'''
 import 'package:test/a.dart';
@@ -466,7 +466,7 @@
     }
 
     var path = convertPath('/home/test/lib/test.dart');
-    newFile2(path, initialCode);
+    newFile(path, initialCode);
 
     var requestedResult =
         await (await session).getLibraryByUri(uriStr) as LibraryElementResult;
diff --git a/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart b/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart
index 62e8adf..c48664f 100644
--- a/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart
+++ b/pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart
@@ -951,7 +951,7 @@
     content = content.substring(0, offset) + content.substring(offset! + 1);
 
     var path = convertPath('/home/test/lib/test.dart');
-    newFile2(path, content);
+    newFile(path, content);
 
     var result = await resolveFile(path);
     findElement = FindElement(result.unit);
diff --git a/pkg/analyzer_plugin/test/support/abstract_context.dart b/pkg/analyzer_plugin/test/support/abstract_context.dart
index 9dffef5..7663cde 100644
--- a/pkg/analyzer_plugin/test/support/abstract_context.dart
+++ b/pkg/analyzer_plugin/test/support/abstract_context.dart
@@ -63,7 +63,7 @@
   String get workspaceRootPath => convertPath('/home');
 
   void addSource(String path, String content) {
-    newFile2(path, content);
+    newFile(path, content);
   }
 
   AnalysisContext contextFor(String path) {
@@ -85,16 +85,16 @@
       }
     }
 
-    newFile2(testPackageAnalysisOptionsPath, buffer.toString());
+    newFile(testPackageAnalysisOptionsPath, buffer.toString());
   }
 
   @override
-  File newFile2(String path, String content) {
+  File newFile(String path, String content) {
     if (_analysisContextCollection != null && !path.endsWith('.dart')) {
       throw StateError('Only dart files can be changed after analysis.');
     }
 
-    return super.newFile2(path, content);
+    return super.newFile(path, content);
   }
 
   Future<ResolvedUnitResult> resolveFile(String path) async {
@@ -123,7 +123,7 @@
   }
 
   void writePackageConfig(String path, PackageConfigFileBuilder config) {
-    newFile2(path, config.toContent(toUriStr: toUriStr));
+    newFile(path, config.toContent(toUriStr: toUriStr));
   }
 
   void writeTestPackageConfig({
diff --git a/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart b/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart
index b1e4ddf..87403be 100644
--- a/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart
+++ b/pkg/analyzer_plugin/test/utilities/analyzer_converter_test.dart
@@ -653,7 +653,7 @@
   @override
   void setUp() {
     super.setUp();
-    source = newFile2('/foo/bar.dart', '').createSource();
+    source = newFile('/foo/bar.dart', '').createSource();
     testFile = convertPath('$testPackageRootPath/lib/test.dart');
   }
 }
diff --git a/pkg/analyzer_plugin/test/utilities/completion/type_member_contributor_test.dart b/pkg/analyzer_plugin/test/utilities/completion/type_member_contributor_test.dart
index 2af7bb7..3c42768 100644
--- a/pkg/analyzer_plugin/test/utilities/completion/type_member_contributor_test.dart
+++ b/pkg/analyzer_plugin/test/utilities/completion/type_member_contributor_test.dart
@@ -1084,7 +1084,7 @@
   }
 
   Future<void> test_Block_unimported() async {
-    newFile2('$workspaceRootPath/myBar/bar.dart', 'class Foo2 { Foo2() { } }');
+    newFile('$workspaceRootPath/myBar/bar.dart', 'class Foo2 { Foo2() { } }');
     addSource(
         '/proj/testAB.dart', 'import "package:myBar/bar.dart"; class Foo { }');
     addTestSource('class C {foo(){F^}}');
diff --git a/pkg/nnbd_migration/test/abstract_context.dart b/pkg/nnbd_migration/test/abstract_context.dart
index d4e0c8e..b30e6a0 100644
--- a/pkg/nnbd_migration/test/abstract_context.dart
+++ b/pkg/nnbd_migration/test/abstract_context.dart
@@ -109,7 +109,7 @@
   File addPackageFile(String packageName, String pathInLib, String content) {
     var packagePath = '/.pub-cache/$packageName';
     knownPackages.add(packageName);
-    return newFile2('$packagePath/lib/$pathInLib', content);
+    return newFile('$packagePath/lib/$pathInLib', content);
   }
 
   /// Add the quiver package and a library with URI,
@@ -125,7 +125,7 @@
   }
 
   Source addSource(String path, String content, [Uri? uri]) {
-    File file = newFile2(path, content);
+    File file = newFile(path, content);
     return file.createSource(uri);
   }
 
@@ -171,13 +171,13 @@
     );
 
     newFolder(testsPath);
-    newFile2('$testsPath/.packages', '''
+    newFile('$testsPath/.packages', '''
 tests:file://$testsPath/lib
 ''');
     var pubspecPath = '$testsPath/pubspec.yaml';
     // Subclasses may write out a different file first.
     if (!getFile(pubspecPath).exists) {
-      newFile2(pubspecPath, '''
+      newFile(pubspecPath, '''
 name: tests
 version: 1.0.0
 environment:
@@ -215,7 +215,7 @@
       'generator': 'pub',
       'generatorVersion': '2.10.0'
     };
-    newFile2('$testsPath/.dart_tool/package_config.json',
+    newFile('$testsPath/.dart_tool/package_config.json',
         JsonEncoder.withIndent('  ').convert(packageConfigJson));
     _analysisContextCollection = AnalysisContextCollectionImpl(
       includedPaths: [convertPath(homePath)],
diff --git a/pkg/nnbd_migration/test/abstract_single_unit.dart b/pkg/nnbd_migration/test/abstract_single_unit.dart
index c5b466d..40b921f 100644
--- a/pkg/nnbd_migration/test/abstract_single_unit.dart
+++ b/pkg/nnbd_migration/test/abstract_single_unit.dart
@@ -62,7 +62,7 @@
   void setUp() {
     var testRoot = testsPath;
     if (analyzeWithNnbd) {
-      newFile2('$testRoot/analysis_options.yaml', '''
+      newFile('$testRoot/analysis_options.yaml', '''
 analyzer:
   enable-experiment:
     - non-nullable
diff --git a/pkg/nnbd_migration/test/already_migrated_code_decorator_test.dart b/pkg/nnbd_migration/test/already_migrated_code_decorator_test.dart
index 4670640..eefd869 100644
--- a/pkg/nnbd_migration/test/already_migrated_code_decorator_test.dart
+++ b/pkg/nnbd_migration/test/already_migrated_code_decorator_test.dart
@@ -612,7 +612,7 @@
 
 class _ContextWithFiles with ResourceProviderMixin {
   Future<_ContextWithUnitElement> buildUnitElement(String content) async {
-    var file = newFile2('/home/test/lib/test.dart', content);
+    var file = newFile('/home/test/lib/test.dart', content);
 
     var sdkRoot = newFolder('/sdk');
     createMockSdk(
diff --git a/pkg/nnbd_migration/test/api_test.dart b/pkg/nnbd_migration/test/api_test.dart
index a60ba1b..68359b0 100644
--- a/pkg/nnbd_migration/test/api_test.dart
+++ b/pkg/nnbd_migration/test/api_test.dart
@@ -54,10 +54,10 @@
       bool warnOnWeakCode = false,
       bool allowErrors = false}) async {
     for (var path in migratedInput.keys) {
-      newFile2(path, migratedInput[path]!);
+      newFile(path, migratedInput[path]!);
     }
     for (var path in input.keys) {
-      newFile2(path, input[path]!);
+      newFile(path, input[path]!);
     }
     var listener = TestMigrationListener();
     var migration = NullabilityMigration(listener,
diff --git a/pkg/nnbd_migration/test/front_end/analysis_abstract.dart b/pkg/nnbd_migration/test/front_end/analysis_abstract.dart
index 41f2ec0..1ae62ea 100644
--- a/pkg/nnbd_migration/test/front_end/analysis_abstract.dart
+++ b/pkg/nnbd_migration/test/front_end/analysis_abstract.dart
@@ -16,14 +16,14 @@
   AbstractAnalysisTest();
 
   void addAnalysisOptionsFile(String content) {
-    newFile2(
+    newFile(
         resourceProvider.pathContext
             .join(projectPath!, 'analysis_options.yaml'),
         content);
   }
 
   String? addTestFile(String content) {
-    newFile2(testFile!, content);
+    newFile(testFile!, content);
     testCode = content;
     return testFile;
   }
diff --git a/pkg/nnbd_migration/test/front_end/nnbd_migration_test_base.dart b/pkg/nnbd_migration/test/front_end/nnbd_migration_test_base.dart
index b061405..df2501c 100644
--- a/pkg/nnbd_migration/test/front_end/nnbd_migration_test_base.dart
+++ b/pkg/nnbd_migration/test/front_end/nnbd_migration_test_base.dart
@@ -193,7 +193,7 @@
     shouldBeMigratedFunction ??= (String? path) => true;
     var testPaths = <String>[];
     files.forEach((String path, String content) {
-      newFile2(path, content);
+      newFile(path, content);
       testPaths.add(path);
     });
     pathsToProcess ??= testPaths;
diff --git a/pkg/nnbd_migration/test/instrumentation_test.dart b/pkg/nnbd_migration/test/instrumentation_test.dart
index d0913a7..ed7e265 100644
--- a/pkg/nnbd_migration/test/instrumentation_test.dart
+++ b/pkg/nnbd_migration/test/instrumentation_test.dart
@@ -142,7 +142,7 @@
   Future<void> analyze(String content,
       {bool removeViaComments = false, bool warnOnWeakCode = true}) async {
     var sourcePath = convertPath('$testsPath/lib/test.dart');
-    newFile2(sourcePath, content);
+    newFile(sourcePath, content);
     var listener = TestMigrationListener();
     var migration = NullabilityMigration(listener,
         instrumentation: _InstrumentationClient(this),
diff --git a/tools/VERSION b/tools/VERSION
index 20084da..6c9080c 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 18
 PATCH 0
-PRERELEASE 33
+PRERELEASE 34
 PRERELEASE_PATCH 0
\ No newline at end of file