Skip to content

Commit c8f8ba6

Browse files
fshcheglovCommit Queue
authored andcommitted
Deprecate Element.accept2, use accept instead.
Change-Id: I4ec0389663164b8dde0b0321e4457f2ae655785a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/435745 Reviewed-by: Konstantin Shcheglov <[email protected]> Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Paul Berry <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent b402fac commit c8f8ba6

File tree

9 files changed

+177
-49
lines changed

9 files changed

+177
-49
lines changed

pkg/analysis_server/lib/src/cider/completion.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class CiderCompletionComputer {
225225
);
226226
var exportMap = element.exportNamespace.definedNames2;
227227
for (var definedElement in exportMap.values) {
228-
definedElement.accept2(visitor);
228+
definedElement.accept(visitor);
229229
}
230230
return suggestionBuilder.suggestions.toList();
231231
}

pkg/analyzer/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
* Deprecate `DartType.element3`, use `element` instead.
7373
* Deprecate `LibraryElement.loadLibraryFunction2`, use `loadLibraryFunction` instead.
7474
* Deprecate `InterfaceType.constructors2`, use `constructors` instead.
75+
* Deprecate `Element.accept2`, use `accept` instead.
7576

7677
## 7.4.1
7778
* Restore `InstanceElement.augmented` getter.

pkg/analyzer/api.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3377,7 +3377,8 @@ package:analyzer/dart/element/element.dart:
33773377
nonSynthetic (getter: Element)
33783378
nonSynthetic2 (getter: Element, deprecated)
33793379
session (getter: AnalysisSession?)
3380-
accept2 (method: T? Function<T>(ElementVisitor2<T>))
3380+
accept (method: T? Function<T>(ElementVisitor2<T>))
3381+
accept2 (method: T? Function<T>(ElementVisitor2<T>), deprecated)
33813382
displayString2 (method: String Function({bool multiline, bool preferTypeAlias}))
33823383
getExtendedDisplayName2 (method: String Function({String? shortName}))
33833384
isAccessibleIn2 (method: bool Function(LibraryElement))

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,13 @@ abstract class Element {
700700
///
701701
/// Returns the value returned by the visitor as a result of visiting this
702702
/// element.
703+
T? accept<T>(ElementVisitor2<T> visitor);
704+
705+
/// Uses the given [visitor] to visit this element.
706+
///
707+
/// Returns the value returned by the visitor as a result of visiting this
708+
/// element.
709+
@Deprecated('Use accept instead')
703710
T? accept2<T>(ElementVisitor2<T> visitor);
704711

705712
/// The presentation of this element as it should appear when presented to

0 commit comments

Comments
 (0)