Skip to content
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

Elements. Migrate to Element2 #3968

Merged
merged 2 commits into from
Jan 24, 2025
Merged

Elements. Migrate to Element2 #3968

merged 2 commits into from
Jan 24, 2025

Conversation

keertip
Copy link
Collaborator

@keertip keertip commented Jan 22, 2025

Element Model migration:

  • test/documentation_comment_test.dart
  • test/mustachio/runtime_renderer_builder_test.dart
  • test/src/utils.dart
  • tool/mustachio/codegen_aot_compiler.dart

@keertip
Copy link
Collaborator Author

keertip commented Jan 22, 2025

@dart-lang/analyzer-team

@@ -315,7 +316,7 @@ class Library extends ModelElement

/// 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);
Copy link
Contributor

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?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

UnmodifiableMapView<Element2?, Map<PackageWarning, Set<String>>>
get countedWarnings2 => UnmodifiableMapView(_countedWarnings.map((key,
value) =>
MapEntry(key != null ? (key.asElement2 as Element2) : null, value)));
Copy link
Contributor

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?

Copy link
Collaborator Author

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.

@keertip keertip merged commit 56934b7 into dart-lang:main Jan 24, 2025
9 checks passed
@keertip keertip deleted the migrate2 branch January 24, 2025 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants