-
Notifications
You must be signed in to change notification settings - Fork 130
Elements. Migrate to Element2 #3968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@dart-lang/analyzer-team |
lib/src/model/library.dart
Outdated
| /// The real packageMeta, as opposed to the package we are documenting with. | ||
| late final PackageMeta? packageMeta = | ||
| packageGraph.packageMetaProvider.fromElement(element2, config.sdkDir); | ||
| packageGraph.packageMetaProvider.fromElement(element as LibraryElementImpl, config.sdkDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need specifically LibraryElementImpl here, or LibraryElement2?
Can we use .asElement2 instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
lib/src/warnings.dart
Outdated
| UnmodifiableMapView<Element2?, Map<PackageWarning, Set<String>>> | ||
| get countedWarnings2 => UnmodifiableMapView(_countedWarnings.map((key, | ||
| value) => | ||
| MapEntry(key != null ? (key.asElement2 as Element2) : null, value))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a strange cast key.asElement2 as Element2.
We expect to get Element2 from asElement2, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed that, fixed. Would attribute this to the auto complete AI plugin.
Element Model migration: