Commit Graph

173 Commits

Author SHA1 Message Date
Sam Rawlins 2dc94ee84a analyzer: Rename DiagnosticCode.errorSeverity to DiagnosticCode.severity
Change-Id: I244a96a940f82902a20e817fd13fe32026607ce3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430581
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-22 17:25:01 -07:00
Sam Rawlins ef300f558c analyzer: allow LintCode instances to set their own severity
Work towards https://github.com/dart-lang/sdk/issues/53402

Letting plugin authors set the default severity of a lint code is a
top request. Users can still customize severities with analysis
options.

Change-Id: Id0a360f4a96ca9627f00d63d3487bfde554b74e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430260
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-22 12:51:30 -07:00
Sam Rawlins f2d416b866 analyzer: simplify PackageConfigFileBuilder.toContent
This API did not exist (was not public) in analyzer 7.4.x, so is safe
to change in 8.0.0.

Change-Id: Ib4a06008b1cdf1be4f33dcb9036ea87b6d258067
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430041
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-22 10:58:49 -07:00
Sam Rawlins 7a4c651eb3 analyzer: Rename 'errorCode' parameters in ErrorReporter
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: I4a3d320585967a4d2e8cbed430d2a67aa3f905fb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/430040
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-21 16:12:59 -07:00
Konstantin Shcheglov 64baa393e5 Elements. Deprecate JoinPatternVariableElement.variables2, use 'variables' instead.
Change-Id: Ie896718aa19a5867be1a05a210ffb28a0daaa79e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429824
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-21 13:59:30 -07:00
Konstantin Shcheglov 5d175fa43c Elements. Deprecate InterfaceElement.constructors2, use constructors.
Change-Id: I78faea1fdbc55e46cdb7fc0b187d12561736cec2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/429822
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-20 15:11:42 -07:00
Sam Rawlins 540efbbb5d analyzer: Extract some public API from WorkspacePackage
Fixes https://github.com/dart-lang/sdk/issues/60725

Change-Id: I63e79075d6538810ddc518e96b5bb7430e55496b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428564
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-19 16:24:19 -07:00
Konstantin Shcheglov adb4a8a559 Elements. Deprecate InstanceFragment.xyz2, use 'xyz' instead.
Change-Id: I18331cc6a2cd0c9f01de79d8d5ea0178cd39dc16
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428881
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-16 10:29:02 -07:00
Konstantin Shcheglov 78bc6da66c Elements. Deprecate InstanceElement.xyz2, use 'xyz' instead.
Change-Id: Ie12b7596b70c77fd2f08520a423eeaf3b6978326
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-16 10:24:25 -07:00
Jens Johansen 88db201efc [analyzer] Replace pathContext.relative inside LocatedGlob.matches
Comparing a before and an after aot-compiled analysis server,
running each 25 times, via `pkg/front_end/tool/benchmarker.dart`:

```
out/ReleaseX64/dart pkg/front_end/tool/benchmarker.dart \
  --iterations=25 \
  --snapshot=pkg/analysis_server/bin/server.aot.1 \
  --snapshot=pkg/analysis_server/bin/server.aot.2 \
  --arguments="--disable-file-byte-store" \
  --arguments="--train-using" \
  --arguments="pkg/front_end/lib/"
```

(where `server.aot.1` is an aot-compile without this CL and
`server.aot.2` is an aot-compile with this CL) gets this result:

```
msec task-clock:u: -5.2977% +/- 0.4313% (-466.26 +/- 37.96) (8801.11 -> 8334.86)
page-faults:u: -2.5748% +/- 0.1648% (-4094.76 +/- 262.07) (159032.16 -> 154937.40)
cycles:u: -5.5212% +/- 0.4440% (-2034156211.44 +/- 163567376.21) (36842412971.36 -> 34808256759.92)
instructions:u: -8.2456% +/- 0.0556% (-4125031082.64 +/- 27819990.07) (50026884750.04 -> 45901853667.40)
branch-misses:u: -4.2637% +/- 2.0984% (-5839704.08 +/- 2873998.26) (136961902.80 -> 131122198.72)
seconds time elapsed: -5.2895% +/- 0.4311% (-0.47 +/- 0.04) (8.82 -> 8.35)
seconds user: -5.5473% +/- 0.5002% (-0.47 +/- 0.04) (8.46 -> 7.99)
Scavenge(   new space) goes from 152 to 134
MarkSweep(   promotion) goes from 15 to 14
Notice combined GC time goes from 2804 ms to 2707 ms (notice only 1 run each).
```
Change-Id: Ib5070b3c037b30f96bb91b3536d85b85ebe0c30c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-05-16 01:28:25 -07:00
Konstantin Shcheglov 05da3e1f22 Elements. Deprecate Element.enclosingElement2, use enclosingElement.
Change-Id: I055b1f9dd1c00605d813effcbbadb9cea874129a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428860
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-15 13:47:32 -07:00
Konstantin Shcheglov c6722fc566 Elements. Rename / deprecate ClassElement.isXyzIn
Change-Id: I5ebc171cd8de04526cdde35f4140635f6bea7edd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/428845
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-15 12:36:00 -07:00
Konstantin Shcheglov 7eea262f06 Deprecate NamedType.name2, use 'name' instead.
Change-Id: I27725e1530c60a6aa2e197b97e027de1238c964a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427980
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-12 08:35:59 -07:00
Sam Rawlins 3021cc4913 analyzer: Move PackageConfigFileBuilder to public API.
Work towards https://github.com/dart-lang/sdk/issues/55660

Change-Id: I3df2cd374f6b3ef9e027f0e07c748be6ea21ebb2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427586
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-09 10:57:55 -07:00
Konstantin Shcheglov 4aeb6c2544 Remove deprecated AnalysisContext.analysisOptions
Change-Id: Ie89087c4cbab17207371254d896f5b2be4ed437b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427602
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-09 10:49:01 -07:00
Sam Rawlins abd4e7754c Introduce two subclasses of 'LintRule' for handling multiple lint codes
Before this change, we had an enforcement that either 'get lintCode' or
'get lintCodes' is implemented, but it was a runtime enforcement. And it
was a little roundabout.

The new system is simpler and more typical:
* `AbstractLintRule` is the parent type, and it's sealed. It provides
  `get lintCodes` as an interface. Code outside of the lint rules
  requires this getter, in registering codes, etc.
* `LintRule` is the new subclass which is the "90% case." It declares
  a `get lintRule`, and offers simpler reporting methods for reporting
  a single code everywhere.
* `MultiLintRule` is the new subclass which represents that last
  "10% case." It only declares the reporting methods which all require
  a LintCode parameter, since there is no concept of a "default lint
  code among all my lint codes."

Work towards https://github.com/dart-lang/sdk/issues/50986

Change-Id: I63cbbfc1d936bb4428aa0b8f5fb0638c9b61b3dc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426284
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-08 16:10:57 -07:00
Sam Rawlins 8a17ad9f05 analyzer: Deprecate AnalysisError in favor of Diagnostic
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: If9bbc96beed95129b099588c5bd9728afda8e392
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426902
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-08 14:02:16 -07:00
Sam Rawlins 739ca671af Deprecate MemoryResourceProvider.convertPath in favor of extension
Work towards https://github.com/dart-lang/sdk/issues/55660

The comment for `MemoryResourceProvider.convertPath` includes:

> This is a utility method for testing; paths passed in to other
> methods in this class are never converted automatically.

and indeed, the actual impl of this method is found in an extension,
in analyzer's test_utilities/ directory. It seems to me better to
leave a testing utility as a testing utility, and not expose it in
the public API of MemoryResourceProvider.

Additionally, the extension method is used by `ResourceProviderMixin`,
which is moving to the public analyzer_testing package. It is illegal
to have a circular non-dev dependency between the analyzer package
and the analyzer_testing package.

The migration for the ~half dozen test files that use this method is
to call the extension method directly. Sometimes with an extension
override, and sometimes without.

Change-Id: I9c2e18600461134bfd91c082b3af0d5079600f0c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426984
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-05-07 13:10:03 -07:00
Brian Wilkerson 5d6dc673dc Make nodeCovering a method on CompilationUnitImpl rather than an extension method
This allows us to traverse the children without needing to create lists.
It also allows us to iterate over lists of nodes more efficiently.

Tested against the script that computes fixes for 10,000 diagnostics,
I'm seeing the following result.

  Before this CL the average time was 10692.4 ms.
  After this CL the average time was 1900.0 ms.

That's just over an 82% improvement.

Change-Id: Ideff745288c8990e9948b22c5204d176af3cac6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426904
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-05-07 09:05:52 -07:00
Sam Rawlins 49562fd152 analyzer: Deprecate ErrorCode in favor of replacement: DiagnosticCode
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: I0cfc0bff4e5d10b7cb373f77de55fffc13b8cf76
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426641
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-06 14:43:10 -07:00
Sam Rawlins 9ab2139df5 analyzer: Deprecate ErrorSeverity in favor of DiagnosticSeverity
Work towards https://github.com/dart-lang/sdk/issues/60635

Change-Id: Ic7f84584d4185e1ab7e8741052ec6694487c8c08
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426600
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-05 13:58:32 -07:00
Sam Rawlins fafad4e03d analyzer: Move the API tool so that it can generate API for other packages
Also, add some scripts to generate the analyzer_testing API, and checkin
the api.txt file for analyzer_testing.

In order to avoid a private analyzer import, I add `isExperimental` and
`hasExperimental` support for `@experimental` annotation, and switch
to using public APIs in `_dumpElement`.

Change-Id: I44319270d4e6083b80973b45933268c472876232
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/426282
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-05-02 14:22:31 -07:00
Konstantin Shcheglov c644933a82 Elements. Make ElementDirective abstract, not sealed.
This allows to have `ElementDirectiveImpl` internally.

Presubmit in google3 is green: cl/752778004

Change-Id: Ia56ad45fab8d95aa5a089aae338414a7f5c4d549
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-05-01 12:21:50 -07:00
Sam Rawlins 23b3450c8e analyzer: Make AnalysisError an alias for Diagnostic
Work towards https://github.com/dart-lang/sdk/issues/60635

Diagnostic has exactly one direct subclass, AnalysisError
(AnalysisError has a few more for tests). Diagnostic was previously
referenced only 7 times in all of analyzer.

This change is essentially a no-op.

Change-Id: I043970d96adcd7be4bb6a24d4a85b3f74309b7d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425682
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-05-01 10:08:05 -07:00
Sam Rawlins 35e8b9ba0b analyzer: Deprecate ErrorType in favor of new name, DiagnosticType
Change-Id: I552e816de6d526e3476cac9dd3ee2919fc7ec499
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425720
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Kevin Moore <kevmoo@google.com>
2025-04-30 19:07:42 -07:00
Sam Rawlins 992cfb13bc analyzer: Deprecate AnalysisError.correction; simplify other final fields
Work towards https://github.com/dart-lang/sdk/issues/60635

* `AnalysisError._contextMessages` unnecessarily backed the public
  `contextMessages` getter; the field is final so it can be public
  itself.
* `AnalysisError._correctionMessage` unnecessarily backed the public
  `correctionMessage` getter; the field is final so it can be public
  itself.

Change-Id: If269d4ed590ef7df81d9b9e3be03766601526d7f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425620
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-04-30 16:06:19 -07:00
Kallen Tu c12926e3a9 [analyzer] Dot shorthands: Const constructor invocations.
Added `isConst` and `constKeyword` to `DotShorthandConstructorInvocation`.

`DotShorthandInvocation`s are rewritten to `DotShorthandConstructorInvocation` immediately once we parse the `const` keyword. If we don't resolve to a constructor, we'll produce the `CONST_WITH_UNDEFINED_CONSTRUCTOR` error.

Summary changes in a different CL that follows this one: https://dart-review.googlesource.com/c/sdk/+/424340

co19 tests passing and unit tests added.

Bug: https://github.com/dart-lang/sdk/issues/59835
Change-Id: Ic12cd98cf08009187b8bf32afb62aa026cb7c8c7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424240
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2025-04-29 18:50:58 -07:00
Sam Rawlins d1696f890d CFE: Introduce type aliases for ErrorCode, ErrorSeverity, ErrorType
Work towards https://github.com/dart-lang/sdk/issues/60635

In this CL I only introduce the typedefs, update comments, and export
the typedefs. I don't change any references. Next we should update
internal references and maybe separately, any generated references.

Change-Id: I1c6d16580533b9283934261f56a6e5237e59109e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/425343
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-04-29 16:19:30 -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 a564aef5eb Elements. Remove ElementLocation.
Change-Id: I92b46c19878e4b0e27d2bf5e08b90bbb666df1e1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424580
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-04-25 09:50:07 -07:00
Konstantin Shcheglov 05d1658495 Elements. Move everything from element2.dart into element.dart, re-export.
I do not deprecate element2.dart in this CL, to make the change smaller, but I will in a following CL.

Change-Id: I78b73eea5b47cf62122daae74c0bfe6e5bb8b0ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424581
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-04-25 08:37:33 -07:00
Danny Tuppeny 16d6594346 [analysis_server] Wire up analysis_options formatter/trailing_commas to formatter
+ validation + code completion

Fixes https://github.com/dart-lang/sdk/issues/60599

Change-Id: I383c888756e29e091c7abf8d4b8df66387714e31
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/424440
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2025-04-24 11:59:05 -07:00
Sam Rawlins 41461344d5 analyzer/linter: Support an @awaitNotRequired annotation
Work towards https://github.com/dart-lang/sdk/issues/46218

This implements the bulk of the `@awaitNotRequired` support as specified here: https://github.com/dart-lang/sdk/issues/46218#issuecomment-2725895048

Remaining work:

* implement inheritence
* report a badly-placed annotation
* add the annotation to the real meta package

Change-Id: Ida16018746704d0baa165ab9be95187b52a79061
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423923
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-04-23 10:53:39 -07:00
Paul Berry edd14f32ff [analyzer] Introduce a new ForLoop class.
This class is part of the public API, and contains the functionality
that's common to ForElement and ForStatement.

Adding this class allows us to change the type of
`ForLoopParts.parent` from `AstNode?` to `ForLoop`. I intend to make
use of this in a follow-up CL that makes improvements to the "remove
dead code" fix, as part of my work on sound flow analysis.

Change-Id: I93ca15d2eeea495064b70690584b7a91058510f7
Bug: https://github.com/dart-lang/sdk/issues/60438
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423560
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2025-04-23 05:44:11 -07:00
Konstantin Shcheglov 564e9384c0 Remove deprecated RecordType.positionalTypes/sortedNamedTypes
Change-Id: I9fd4768abe3956a7e82291de3f8a2f0b9f606959
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423602
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-22 08:50:30 -07:00
Konstantin Shcheglov cdab11ca77 Remove deprecated DartType.isStructurallyEqualTo
Change-Id: Ibf7ec9f5af9011a162c1db5080702fddbdd4f27c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423601
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2025-04-22 07:26:09 -07:00
Sam Rawlins 0f82e22798 analyzer: Remove unnecessary AnalysisTarget
This just seems like an odd parent class for both Element and
ConstantEvaluationTarget. I don't think it carries it's weight (added
complexity).

The abstract AnalysisTarget serves as an interface that adds only two
getters to the contract: `Source? get librarySource` and
`Source? get source`, and is only referenced by two classes: `Element`
implements it, and `ConstantEvaluationTarget` extends it (but it's
abstract anyway).

So to me it seems this is a false type hierarchy; just because Element
and ConstantEvaluationTarget both have a source and a librarySource
field does not mean that it is useful or meaningful to encode this
information in the type hierarchy.

Change-Id: I08ef8e32d3ead6a969950ff34f76baa84272b662
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/399321
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-04-21 10:42:50 -07:00
FMorschel befa614a90 [DAS] Optimizes library resolution for bulk_fix_processor
Bug: https://github.com/dart-lang/sdk/issues/60472
Change-Id: Ia26b47f94e0851ae5da6e52fde3f9a2c4a3a0d20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2025-04-21 09:47:14 -07:00
Konstantin Shcheglov a4171e715b Elements. Remove V1 Element.
Change-Id: Icf4941f3ff2765ea0d5fd7728604c77607327595
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423447
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-04-21 08:52:03 -07:00
Konstantin Shcheglov 96fe407ce7 Elements. Remove V1 Element.thisOrAncestorMatchingX() methods.
Change-Id: I0a788b2fa3d849d55a4690b59aab1fa6ef4ff04e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423446
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-21 08:46:36 -07:00
Konstantin Shcheglov 67b9a1be74 Elements. Remove V1 Element used in scopes.
Change-Id: Ic4f838e9033942137b1d4a855d9d378bb2a1931f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423073
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-04-21 08:38:34 -07:00
Konstantin Shcheglov de2b3fa1cd Elements. Remove V1 ElementAnnotation.element
Change-Id: Iea9716d71cbb4cf8bb0504ae9847fd613b0d9811
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423444
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-04-21 08:35:58 -07:00
Konstantin Shcheglov ba86b99628 Elements. Remove V1 UriReferencedElement.
Change-Id: I3590bde0ffb50ae3e85c71d436201294c5390dfd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423072
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-21 08:30:32 -07:00
Konstantin Shcheglov 34a97d2c9f Elements. Remove V1 LibraryElement.
Change-Id: I01c41cc34511565cf994c27314f6e41024db8f9d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423443
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-21 08:27:54 -07:00
Konstantin Shcheglov 87ccd492a7 Elements. Remove V1 AnalysisSession.getParsedLibraryByElement and getResolvedLibraryByElement.
Change-Id: Ia124a11f3074a2f8d05c3ec517e59d8b6828af91
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423071
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-21 08:19:51 -07:00
Konstantin Shcheglov 0de0695c2c Elements. Remove V1 PartElement.
Change-Id: Id78a06bcebb84c343e79111d1bad0ebe92680bca
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423442
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-21 08:14:26 -07:00
Konstantin Shcheglov 07d53499d9 Elements. Remove V1 LibraryImportElement.
Change-Id: I4e4c4affd3edef452ece80133f32a2d7dacc1511
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-21 08:11:48 -07:00
Konstantin Shcheglov 79aa9ca3e3 Elements. Remove V1 LibraryExportElement.
Change-Id: I7c334034cf3c19101b4f8b7bec7d6da243112941
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423070
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-21 08:06:22 -07:00
Konstantin Shcheglov a477b7eb42 Elements. Remove V1 VariableElement.
Change-Id: Ib326d8d1e22954bfb8b567917357e4687e488c13
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423069
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2025-04-21 08:03:45 -07:00
Konstantin Shcheglov 3c5193f9f1 Elements. Remove V1 LocalElement, PromotableElement.
Change-Id: Ifd11fcfd740c848e570ef076b20b9e43bbeb0cea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/423066
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-04-21 07:58:19 -07:00