Skip to content

Commit

Permalink
Elements. Write Element2 as firstFragment#element.
Browse files Browse the repository at this point in the history
In many cases `element:` property is not very interesting, and we
should replace it with checking cross-linking between elements and
fragments.

I kept `element:` for now as a demonstration.

However there are also useful additions, see: superConstructor: <testLibraryFragment>::@Class::A::@constructor::new#element
in class_test.dart

Change-Id: I1ad16ddcf73be6af81da92f1d831d5b165629860
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385362
Reviewed-by: Brian Wilkerson <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
  • Loading branch information
scheglov authored and Commit Queue committed Sep 18, 2024
1 parent ab8693b commit d695bd0
Show file tree
Hide file tree
Showing 29 changed files with 12,884 additions and 12,583 deletions.
27 changes: 2 additions & 25 deletions pkg/analyzer/test/src/summary/element_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -482,31 +482,8 @@ class _Element2Writer extends _AbstractElementWriter {
if (e == null) {
return;
}
if (e is MaybeAugmentedInstanceElementMixin) {
e = e.declaration;
}
if (e is ElementImpl) {
if (e.reference case var reference?) {
_sink.writeIndentedLine(() {
_sink.write(name);
_sink.write(': ');
_elementPrinter.writeReference(reference);
});
}
// } else if (e is MethodElementImpl2) {
// if (e.reference case var reference?) {
// _sink.writeIndentedLine(() {
// _sink.write(label ?? 'reference: ');
// _elementPrinter.writeReference(reference);
// });
// }
} else {
_sink.writeIndentedLine(() {
_sink.write(name);
_sink.write(': ');
_sink.write('<none>');
});
}

_elementPrinter.writelnNamedElement2(name, e);
}

void _writeExportNamespace(LibraryElement2 e) {
Expand Down
Loading

0 comments on commit d695bd0

Please sign in to comment.