Skip to content

Commit 67b9a1b

Browse files
scheglovCommit Queue
authored andcommitted
Elements. Remove V1 Element used in scopes.
Change-Id: Ic4f838e9033942137b1d4a855d9d378bb2a1931f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423073 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent de2b3fa commit 67b9a1b

File tree

4 files changed

+0
-78
lines changed

4 files changed

+0
-78
lines changed

pkg/analyzer/api.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3896,9 +3896,7 @@ package:analyzer/dart/element/scope.dart:
38963896
lookup (method: ScopeLookupResult Function(String))
38973897
ScopeLookupResult (class extends Object):
38983898
new (constructor: ScopeLookupResult Function())
3899-
getter (getter: Element?, deprecated)
39003899
getter2 (getter: Element2?)
3901-
setter (getter: Element?, deprecated)
39023900
setter2 (getter: Element2?)
39033901
package:analyzer/dart/element/type.dart:
39043902
DartType (class extends Object):
@@ -4333,7 +4331,6 @@ package:analyzer/error/listener.dart:
43334331
lockLevel= (setter: int)
43344332
source (getter: Source)
43354333
atConstructorDeclaration (method: void Function(ConstructorDeclaration, ErrorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}))
4336-
atElement (method: void Function(Element, ErrorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}), deprecated)
43374334
atElement2 (method: void Function(Element2, ErrorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}), experimental)
43384335
atEntity (method: void Function(SyntacticEntity, ErrorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}))
43394336
atNode (method: void Function(AstNode, ErrorCode, {List<Object>? arguments, List<DiagnosticMessage>? contextMessages, Object? data}))
@@ -4695,11 +4692,8 @@ package:analyzer/src/dart/resolver/scope.dart:
46954692
EMPTY (static getter: Namespace)
46964693
EMPTY= (static setter: Namespace)
46974694
new (constructor: Namespace Function(Map<String, Element2>))
4698-
definedNames (getter: Map<String, Element>, deprecated)
46994695
definedNames2 (getter: Map<String, Element2>)
4700-
get (method: Element? Function(String), deprecated)
47014696
get2 (method: Element2? Function(String))
4702-
getPrefixed (method: Element? Function(String, String), deprecated)
47034697
getPrefixed2 (method: Element2? Function(String, String))
47044698
package:analyzer/src/generated/engine.dart:
47054699
AnalysisContext@2 (class extends Object):

pkg/analyzer/lib/dart/element/scope.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
import 'package:analyzer/dart/element/element.dart';
65
import 'package:analyzer/dart/element/element2.dart';
7-
import 'package:analyzer/src/utilities/extensions/element.dart';
86

97
/// Scopes are used to resolve names to elements.
108
///
@@ -22,13 +20,7 @@ abstract class Scope {
2220
///
2321
/// Clients may not extend, implement or mix-in this class.
2422
abstract class ScopeLookupResult {
25-
@Deprecated('Use getter2 instead')
26-
Element? get getter => getter2?.asElement;
27-
2823
Element2? get getter2;
2924

30-
@Deprecated('Use setter2 instead')
31-
Element? get setter => setter2?.asElement;
32-
3325
Element2? get setter2;
3426
}

pkg/analyzer/lib/error/listener.dart

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import 'package:analyzer/dart/ast/ast.dart'
66
show AstNode, ConstructorDeclaration;
77
import 'package:analyzer/dart/ast/syntactic_entity.dart';
88
import 'package:analyzer/dart/ast/token.dart';
9-
import 'package:analyzer/dart/element/element.dart';
109
import 'package:analyzer/dart/element/element2.dart';
1110
import 'package:analyzer/dart/element/type.dart';
1211
import 'package:analyzer/diagnostic/diagnostic.dart';
@@ -97,27 +96,6 @@ class ErrorReporter {
9796
}
9897
}
9998

100-
/// Report an error with the given [errorCode] and [arguments].
101-
/// The [element] is used to compute the location of the error.
102-
@Deprecated('Use atElement2() instead')
103-
void atElement(
104-
Element element,
105-
ErrorCode errorCode, {
106-
List<Object>? arguments,
107-
List<DiagnosticMessage>? contextMessages,
108-
Object? data,
109-
}) {
110-
var nonSynthetic = element.nonSynthetic;
111-
atOffset(
112-
errorCode: errorCode,
113-
offset: nonSynthetic.nameOffset,
114-
length: nonSynthetic.nameLength,
115-
arguments: arguments,
116-
contextMessages: contextMessages,
117-
data: data,
118-
);
119-
}
120-
12199
/// Report an error with the given [errorCode] and [arguments].
122100
/// The [element] is used to compute the location of the error.
123101
@experimental

pkg/analyzer/lib/src/dart/resolver/scope.dart

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,10 @@
44

55
import 'package:_fe_analyzer_shared/src/base/analyzer_public_api.dart';
66
import 'package:_fe_analyzer_shared/src/scanner/string_canonicalizer.dart';
7-
import 'package:analyzer/dart/element/element.dart';
87
import 'package:analyzer/dart/element/element2.dart';
98
import 'package:analyzer/src/dart/ast/ast.dart';
109
import 'package:analyzer/src/dart/element/element.dart';
1110
import 'package:analyzer/src/generated/engine.dart';
12-
import 'package:analyzer/src/utilities/extensions/collection.dart';
13-
import 'package:analyzer/src/utilities/extensions/element.dart';
1411

1512
/// The scope defined by a block.
1613
class BlockScope {
@@ -123,31 +120,14 @@ class Namespace {
123120
/// Initialize a newly created namespace to have the [_definedNames].
124121
Namespace(this._definedNames);
125122

126-
/// Return a table containing the same mappings as those defined by this
127-
/// namespace.
128-
@Deprecated('Use definedNames2 instead')
129-
Map<String, Element> get definedNames =>
130-
_definedNames.mapValue((e) => e.asElement!);
131-
132123
/// Return a table containing the same mappings as those defined by this
133124
/// namespace.
134125
Map<String, Element2> get definedNames2 => _definedNames;
135126

136-
/// Return the element in this namespace that is available to the containing
137-
/// scope using the given name, or `null` if there is no such element.
138-
@Deprecated('Use get2() instead')
139-
Element? get(String name) => _definedNames[name]?.asElement;
140-
141127
/// Return the element in this namespace that is available to the containing
142128
/// scope using the given name, or `null` if there is no such element.
143129
Element2? get2(String name) => _definedNames[name];
144130

145-
/// Return the element in this namespace whose name is the result of combining
146-
/// the [prefix] and the [name], separated by a period, or `null` if there is
147-
/// no such element.
148-
@Deprecated('Use getPrefixed2() instead')
149-
Element? getPrefixed(String prefix, String name) => null;
150-
151131
/// Return the element in this namespace whose name is the result of combining
152132
/// the [prefix] and the [name], separated by a period, or `null` if there is
153133
/// no such element.
@@ -323,27 +303,11 @@ class PrefixedNamespace implements Namespace {
323303
: _prefix = prefix,
324304
_length = prefix.length;
325305

326-
@Deprecated('Use definedNames2 instead')
327-
@override
328-
Map<String, Element> get definedNames {
329-
var definedNames = <String, Element>{};
330-
_definedNames.forEach((name, element) {
331-
definedNames["$_prefix.$name"] = element.asElement!;
332-
});
333-
return definedNames;
334-
}
335-
336306
@override
337307
Map<String, Element2> get definedNames2 {
338308
return _definedNames;
339309
}
340310

341-
@Deprecated('Use get2() instead')
342-
@override
343-
Element? get(String name) {
344-
return get2(name)?.asElement;
345-
}
346-
347311
@override
348312
Element2? get2(String name) {
349313
if (name.length > _length && name.startsWith(_prefix)) {
@@ -354,12 +318,6 @@ class PrefixedNamespace implements Namespace {
354318
return null;
355319
}
356320

357-
@Deprecated('Use getPrefixed2() instead')
358-
@override
359-
Element? getPrefixed(String prefix, String name) {
360-
return getPrefixed2(prefix, name)?.asElement;
361-
}
362-
363321
@override
364322
Element2? getPrefixed2(String prefix, String name) {
365323
if (prefix == _prefix) {

0 commit comments

Comments
 (0)