Elements. Migrate analyzer/test/util/id_testing_helper.dart
Change-Id: Ie92edb3e7fb084f2d46da79d7a52fff33553a539
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406342
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/test/util/id_testing_helper.dart b/pkg/analyzer/test/util/id_testing_helper.dart
index 1e3634e..7ea4b8c 100644
--- a/pkg/analyzer/test/util/id_testing_helper.dart
+++ b/pkg/analyzer/test/util/id_testing_helper.dart
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// ignore_for_file: analyzer_use_new_elements
-
// TODO(johnniwinther): .
// TODO(paulberry): Use the code for extraction of test data from
// annotated code from CFE.
@@ -270,12 +268,6 @@
}
}
return 0;
- } else if (id is LibraryId) {
- var unit =
- parseString(content: code[uri]!.sourceCode, throwIfDiagnostics: false)
- .unit;
- var offset = unit.declaredElement?.library.nameOffset ?? -1;
- return offset >= 0 ? offset : 0;
} else {
throw StateError('Unexpected id ${id.runtimeType}');
}