Skip to content

Commit 999f39e

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove FindElement fields where possible.
Change-Id: Iea32d103f433d88c70de837bba09435b6f52d11a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/410580 Reviewed-by: Brian Wilkerson <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent bfaf70f commit 999f39e

File tree

5 files changed

+0
-17
lines changed

5 files changed

+0
-17
lines changed

pkg/analysis_server/test/abstract_single_unit.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import 'package:analyzer/dart/element/element2.dart';
88
import 'package:analyzer/error/error.dart';
99
import 'package:analyzer/file_system/file_system.dart';
1010
import 'package:analyzer/src/error/codes.g.dart';
11-
import 'package:analyzer/src/test_utilities/find_element.dart';
1211
import 'package:analyzer/src/test_utilities/find_element2.dart';
1312
import 'package:analyzer/src/test_utilities/find_node.dart';
1413
import 'package:analyzer/src/utilities/extensions/analysis_session.dart';
@@ -25,7 +24,6 @@ class AbstractSingleUnitTest extends AbstractContextTest {
2524
late ResolvedUnitResult testAnalysisResult;
2625
late CompilationUnit testUnit;
2726
late FindNode findNode;
28-
late FindElement findElement;
2927
late FindElement2 findElement2;
3028

3129
late LibraryElement2 testLibraryElement;
@@ -52,7 +50,6 @@ class AbstractSingleUnitTest extends AbstractContextTest {
5250
testCode = unitResult.content;
5351
testUnit = unitResult.unit;
5452
findNode = FindNode(testCode, testUnit);
55-
findElement = FindElement(testUnit);
5653
findElement2 = FindElement2(testUnit);
5754
return unitResult;
5855
}
@@ -83,7 +80,6 @@ class AbstractSingleUnitTest extends AbstractContextTest {
8380

8481
testLibraryElement = testUnit.declaredFragment!.element;
8582
findNode = FindNode(testCode, testUnit);
86-
findElement = FindElement(testUnit);
8783
findElement2 = FindElement2(testUnit);
8884
return testAnalysisResult;
8985
}

pkg/analysis_server/test/services/search/search_engine_test.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:analysis_server/src/services/search/search_engine_internal.dart'
77
import 'package:analyzer/dart/analysis/results.dart';
88
import 'package:analyzer/dart/element/element2.dart';
99
import 'package:analyzer/file_system/file_system.dart';
10-
import 'package:analyzer/src/test_utilities/find_element.dart';
1110
import 'package:analyzer/src/test_utilities/find_element2.dart';
1211
import 'package:analyzer/src/test_utilities/find_node.dart';
1312
import 'package:analyzer/src/test_utilities/package_config_file_builder.dart';
@@ -30,7 +29,6 @@ void main() {
3029
class PubPackageResolutionTest extends AbstractContextTest {
3130
late ResolvedUnitResult result;
3231
late FindNode findNode;
33-
late FindElement findElement;
3432
late FindElement2 findElement2;
3533

3634
void addTestFile(String content) {
@@ -42,7 +40,6 @@ class PubPackageResolutionTest extends AbstractContextTest {
4240
result = await getResolvedUnit(file);
4341

4442
findNode = FindNode(result.content, result.unit);
45-
findElement = FindElement(result.unit);
4643
findElement2 = FindElement2(result.unit);
4744
}
4845

pkg/analyzer/test/src/dart/resolution/resolution.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,6 @@ mixin ResolutionTest implements ResourceProviderMixin {
485485
}
486486

487487
extension ResolvedUnitResultExtension on ResolvedUnitResult {
488-
FindElement get findElement {
489-
return FindElement(unit);
490-
}
491-
492488
FindElement2 get findElement2 {
493489
return FindElement2(unit);
494490
}

pkg/analyzer_plugin/test/src/utilities/completion/completion_target_test.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import 'package:analyzer/dart/ast/ast.dart';
66
import 'package:analyzer/dart/element/element2.dart';
7-
import 'package:analyzer/src/test_utilities/find_element.dart';
87
import 'package:analyzer/src/test_utilities/find_element2.dart';
98
import 'package:analyzer_plugin/src/utilities/completion/completion_target.dart';
109
import 'package:test/test.dart';
@@ -888,7 +887,6 @@ class C2 {
888887
class _Base extends AbstractContextTest {
889888
int? offset;
890889
late CompletionTarget target;
891-
late FindElement findElement;
892890
late FindElement2 findElement2;
893891

894892
void assertTarget(
@@ -956,7 +954,6 @@ class _Base extends AbstractContextTest {
956954
newFile(path, content);
957955

958956
var result = await resolveFile(path);
959-
findElement = FindElement(result.unit);
960957
findElement2 = FindElement2(result.unit);
961958

962959
target = CompletionTarget.forOffset(result.unit, offset!);

pkg/analyzer_plugin/test/support/abstract_single_unit.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:analyzer/error/error.dart';
99
import 'package:analyzer/src/dart/ast/element_locator.dart';
1010
import 'package:analyzer/src/dart/ast/utilities.dart';
1111
import 'package:analyzer/src/error/codes.dart';
12-
import 'package:analyzer/src/test_utilities/find_element.dart';
1312
import 'package:analyzer/src/test_utilities/find_element2.dart';
1413
import 'package:analyzer/src/test_utilities/find_node.dart';
1514
import 'package:test/test.dart';
@@ -24,7 +23,6 @@ class AbstractSingleUnitTest extends AbstractContextTest {
2423
late String testFile;
2524
late CompilationUnit testUnit;
2625
late FindNode findNode;
27-
late FindElement findElement;
2826
late FindElement2 findElement2;
2927

3028
void addTestSource(String code) {
@@ -120,7 +118,6 @@ class AbstractSingleUnitTest extends AbstractContextTest {
120118
}), isEmpty);
121119
}
122120
findNode = FindNode(testCode, testUnit);
123-
findElement = FindElement(testUnit);
124121
findElement2 = FindElement2(testUnit);
125122
}
126123

0 commit comments

Comments
 (0)