Commit Graph

72 Commits

Author SHA1 Message Date
Konstantin Shcheglov 2cf84f8053 Elements. Rename most XyzElementImpl into XyzFragmentImpl.
Change-Id: I7902ccedd9d3e9ccde1091eb28aad98591791b6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424922
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-28 08:35:25 -07:00
Konstantin Shcheglov b2fdd8a345 Elements. Rename XyzElement2 into XyzElement.
The CL was done with rename + adding typedef for each class.

Change-Id: Ia25cc581d2e42cf7d12a85a3579af952d5c232ee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424687
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-25 13:27:18 -07:00
Konstantin Shcheglov 49599e06cc Elements. Deprecated element2.dart library.
Change-Id: I2be38df49e6f242d9fe59f34164549da4a0f41b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424683
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-25 11:23:18 -07:00
Konstantin Shcheglov becd91df17 Format analyzer/ with tall mode.
Change-Id: I410cd1cf63fbf00b868bbb3e060433cad3ac9e6c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423520
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-04-21 12:15:58 -07:00
Konstantin Shcheglov 637355a7e9 Elements. Migrate ElementPrinter.
Change-Id: I712c9da94194656b8e85247e2024b8c0c77bf336
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418824
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-03-31 15:37:13 -07:00
Brian Wilkerson 2adeadda02 [migrate] minor cleanup in element_printer.dart
Change-Id: Idc9cbcba6f522c0164afc0b2a4b9559131d3a7ae
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418664
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-03-28 21:24:18 -07:00
Konstantin Shcheglov 8d0037ddc3 Elements. Stop printing V1 resolution.
Change-Id: Ic4e4c7eb94261a15d7b84657408d66b36fead938
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417961
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-03-27 15:09:32 -07:00
Konstantin Shcheglov 790b0a0974 Elements. Fix printing TypeParameterElementImpl2.
Change-Id: I02b792189b3281a319b3a1d3c55a47b29eb29c8e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/417910
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-03-27 14:06:30 -07:00
Konstantin Shcheglov d28ec705d6 Elements. Deprecate Element.enclosingElement3 and related.
Change-Id: I536436b99ddd179114b90307213c9e5a473039f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/418501
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-03-27 14:03:41 -07:00
Konstantin Shcheglov 0990e6b19b Elements. Require ConstructorElementImpl for ConstructorMember.
Change-Id: I8b9ddca7aeaa6c40a03819d16cea50c189dea426
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416882
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-03-20 07:26:32 -07:00
Konstantin Shcheglov 78e1278188 Elements. Remove augmentationSubstitution.
Change-Id: Ic90906b72b6f8344a4142b39d3b1975e58348f79
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/416324
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-03-18 12:22:42 -07:00
Konstantin Shcheglov 77986bd913 Elements. Migrate TypeParameterTypeImpl.
Change-Id: Ib2130458b45a7bd49d2521190894790a7afad294
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415681
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-03-14 13:06:42 -07:00
Konstantin Shcheglov 5ff3c6aabc Elements. Write TypeAliasElement2.
Change-Id: I20f6faf818fe9fb18bdfc2587288131609920f55
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415360
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-03-14 11:41:33 -07:00
Konstantin Shcheglov 7aec38df35 Elements. ElementPrinter always write \n when write Element2, renames.
Change-Id: I9d144881de79450a2cc21ade3953ceec6138feef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/415381
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-03-13 17:25:54 -07:00
Konstantin Shcheglov 91f5aad129 Elements. Deprecate V1 APIs in dart/element/type.dart
Add InterfaceType.getGetter2() and getSetter2().

Change-Id: I9f32fff71a9b643cc9fd46f0aaa87233689a9660
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412940
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-02-28 14:18:59 -08:00
Brian Wilkerson 115dcc9609 [migration] constant/value.dart
Change-Id: Id1ed8bd41b8efb34124ddda93f1039215caf0651
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/411362
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-02-21 12:48:48 -08:00
Sam Rawlins 810af115dc analyzer: Element model migration type_algebra.dart
Change-Id: I18a9e5858ac016154bf1572e0abebebe94518edf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/409740
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-02-13 10:52:38 -08:00
Konstantin Shcheglov 0235cf4efd Elements. Migrate PrefixExpressionResolver.
Change-Id: I0d54fc62353e87e10193d707e9586604585bba37
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406900
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2025-01-30 14:58:05 -08:00
Konstantin Shcheglov dc77d08abd Elements. Migrate PrefixElementResolutionTest into LibraryFragmentElementTest.
Change-Id: Id894f7a51504de5dd9dd8bce62f0fddca4734267
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/406440
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-01-29 09:04:58 -08:00
Konstantin Shcheglov 8bbe6fbdfe Elements. Report analyzer_use_new_elements without any txt file, add file ignores.
Change-Id: I13125f93a6633563ed6853a622bd9fec045bfc0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/403923
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-01-10 15:20:59 -08:00
Brian Wilkerson bda2cbbee3 [Migration] Minor clean-up
Fixes a couple of the places that would have become errors when
`ElementImpl` no longer implements `Element2`. There are other places
that will break, but some of them are dependent on other changes being
made first.

Change-Id: I1041d70909de27ff33ddabc25ffc92b405b2c6c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401721
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-12-18 13:56:11 -08:00
Konstantin Shcheglov 34cf29701b Elements. Migrate test/src/dart/analysis/search_test.dart
Change-Id: I2ff70b68f11497940940b13602bceba998f50c4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401047
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-12-17 09:53:38 -08:00
Konstantin Shcheglov 2d8aec091c Elements. Migrate a few summary tests.
Change-Id: I52791ad27681de7b1507925c9598b824b1ebb7c1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/396568
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-22 00:42:58 +00:00
Konstantin Shcheglov f33de62674 Elements. Build more Element2 objects.
Change-Id: I1856610e12c19c2e0fb502fbc324b562cbbe0006
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-11 20:53:14 +00:00
Brian Wilkerson 15cdbc5eab Migrate five correction producers
Change-Id: I3289e0862797947fadf76d78a2ce27c0cf249dd2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394321
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-11-08 21:08:18 +00:00
Konstantin Shcheglov 39e5e0fdac Elements. Add DynamicElementImpl2, make DynamicElementImpl its fragment.
Change-Id: I1d88f84f59d2ebdf7e0a5bc3b54d2145b0cb42b9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394241
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-08 17:31:26 +00:00
Konstantin Shcheglov f35cbc95e3 Elements. Add NeverElementImpl2, make NeverElementImpl its fragment.
Change-Id: I3ef636dec6a678e30c44f0551276a8b3557a7641
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394240
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-11-07 22:58:46 +00:00
Konstantin Shcheglov 3e6e13dee8 Element. Implement MultiplyDefinedElement2 and MultiplyDefinedFragment.
Bug: https://github.com/dart-lang/sdk/issues/57041
Change-Id: I4272137f6b48dfa784d23d0f9fc206b3bad12819
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394180
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-07 20:54:49 +00:00
Konstantin Shcheglov 53bf3ff846 Elements. Rename to ClassElementImpl2, etc.
Change-Id: I94119f60b5bf01e52cf348a7c67f2b4a5ba62900
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-05 18:42:21 +00:00
Konstantin Shcheglov 7b9d11a6a4 Elements. Write mixins / interfaces / etc of InstanceElement2.
Change-Id: I402d76450bb06a74580292777dae4514c2685e75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393580
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-05 02:36:18 +00:00
Konstantin Shcheglov 1a0273672a Elements. Build TopLevelFunctionElementImpl during building elements.
Give it a reference.

Change-Id: Ie1189a18e9d2794d37e530cbbb01ddd86b78a16e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/393164
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-11-01 22:21:00 +00:00
Konstantin Shcheglov a868303290 Elements. Remove FragmentName, inline as name2 / nameOffset2.
Change-Id: If238cd71867501a39e243261228d137f925db1dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392741
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-01 18:56:26 +00:00
Konstantin Shcheglov 2d0eedc100 Elements. Keep only AugmentedInstanceElementImpl and subclasses.
Having single implementation of `ClassElement2` (and other elements like it) makes the implementation easier now, and simplifies future changes.

Change-Id: Ifd38a8738fff99b7ac0b387140fdd623be18be01
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392780
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-11-01 14:58:14 +00:00
Brian Wilkerson 5ef250a2bf Rework the new element model so that all elements have fragments
Change-Id: Ic4fc0368cabc5fa8dfc21c958e1619777f2701b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392541
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2024-10-31 23:23:39 +00:00
Konstantin Shcheglov 106489ae1c Elements. Add reference for enum, extension, extension type elements.
Change-Id: I1b204a256bf8845959ccde1de5a755994b3ff105
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392101
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-10-28 21:21:29 +00:00
Konstantin Shcheglov 74a2bc7af4 Elements. Add reference for MixinElement2.
Change-Id: I8cce4acc8f499754ff8d5e96930ae1b5d86943a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/392061
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-10-25 20:13:48 +00:00
Konstantin Shcheglov 9e1ac08817 Elements. Add 'ElementImpl2.reference', implement for ClassElement2.
Change-Id: Ie555b0032bba93f9c3d0dcd4cdef819eec6e1187
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391841
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-10-25 00:02:48 +00:00
Konstantin Shcheglov 3af9430ebf Elements. Separate Element2.name from Element.name by renaming to 'name3'.
They were intersecting at ElementImpl and Member(s).

This will unblock updating implementations to make them nullable.

Change-Id: Ic9907eaa0ef08c096839f212668fa1e3d92bbf3d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/391540
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-10-23 15:53:40 +00:00
Brian Wilkerson 450c1962d0 Make members a subtype of element rather than fragment
Change-Id: I4fce1d1a3a63b79dcfc1b61903e5dcabd7771bfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388066
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2024-10-04 18:42:33 +00:00
Konstantin Shcheglov 331ca05414 Elements. Implement PrefixElement2 and PrefixFragment.
Change-Id: I547049096efa1ecf56f7b4adb77d21908d2da4db
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-10-03 19:18:48 +00:00
Konstantin Shcheglov 15540bc90a Elements. Return Element2 from Identifier.element, specifically LocalVariableElement2.
Change-Id: If8cb0e75472b542371f8eea794350135b3551283
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386964
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
2024-09-27 00:26:50 +00:00
Konstantin Shcheglov 776f4e0427 Elements. Unique LocalVariableElementImpl2 instance for LocalVariableElementImpl, print.
And the same for labels.

Change-Id: I64ad24597f87d3104d04118151b79ba9f7c2a79c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386940
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-26 14:25:00 +00:00
Konstantin Shcheglov d063ceb520 Elements. Store 'element2' in NamedTypeImpl, extract 'element' from it.
This is a step toward the state where we eventually want to be.

Change-Id: I8d3062478c08a5aac0992ccccd7848d2c74589de
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-24 15:55:01 +00:00
Konstantin Shcheglov 2fbdc85da0 Elements. Write InterfaceType.element3 where we write elements.
Change-Id: I2a46321d59c83f04f27f67b8335b7f31cddedbe3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386264
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-23 22:14:49 +00:00
Konstantin Shcheglov b058a3a080 Elements. Don't write LibraryImport reference, it does not exist.
Change-Id: I420946f08e04248a4f962a218f95c705b7d7ddfb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386340
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-23 19:55:08 +00:00
Konstantin Shcheglov 09e3261127 Elements. Write FormalParameterElementImpl.
Change-Id: Icb61913fe0a195271e507c61e500a3f2be0ec689
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385960
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-23 16:05:32 +00:00
Konstantin Shcheglov 6e0f03fd5e Elements. Print new elements for resolved AST.
Change-Id: I629151c61fafea61b4fe8cd1ff94a828d2a99754
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/385800
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-19 12:12:28 +00:00
Konstantin Shcheglov d695bd0cbd Elements. Write Element2 as firstFragment#element.
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 <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-18 13:35:52 +00:00
Konstantin Shcheglov d90bb7321a Parts. Remove support for library augmentations.
Change-Id: I04f076ea6917bd4597b79c75db16207ccf387c9b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/383702
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2024-09-05 22:21:33 +00:00
Konstantin Shcheglov 8de1422a0e Parts. Deprecate Element.enclosingElement, use enclosingElement3.
Change-Id: Iadc4ed02d4bda3b882e65dc6f4d263a6a938e0fe
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2024-09-01 18:50:29 +00:00