This adds the dart:_macros library to the SDK and adds support for accessing dart:_macros from package:macros. The library is not used yet.
This change is needed as a prestep to adding the package:macros and using it in the CFE and analyzer, and needs to be rolled in as the checked in sdk before package:macros can be supported.
TEST=ci
Change-Id: Ife3ffd48527e3a196048d2ddf7387b8b7818f3a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348680
Reviewed-by: Jake Macdonald <jakemac@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Chloe Stefantsova <cstefantsova@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
(Note an additional pre-existing test in `context_locatator_test:test_locateRoots_nested_options_overriddenOptions`.)
Fixes https://github.com/dart-lang/sdk/issues/54791
Change-Id: Ie67e9d840bec1caaa3548a8803f3a9b452807249
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/349625
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
This reverts commit 43fb59f4dc.
Reason for revert: Breaking Dart SDK -> Flutter Engine roller. See https://github.com/flutter/flutter/issues/142253
Original change's description:
> Refactor PubWorkspace into PackageConfigWorkspace
>
> - use package_config.json as marker file for workspace.
> - workspace can have multiple packages, they can be either PubPackages (marker pubspec.yaml) or BasicWorkspace.
> - add package info (pubspec) to resolution salt.
> - removed duplication of finding package_config.json from ContextLocator, as this is now done while creating workspace.
> - some test/s setup/expectations were changed since we now use package config as marker for workspace instead of pubspec.
>
> Change-Id: I091a4a686c6b1d8c14858aefd9843a8d9c8efa25
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345346
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
> Commit-Queue: Keerti Parthasarathy <keertip@google.com>
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Change-Id: I59adf5b26d25e360bcf962323db688156774c767
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/348364
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Jackson Gardner <jacksongardner@google.com>
- use package_config.json as marker file for workspace.
- workspace can have multiple packages, they can be either PubPackages (marker pubspec.yaml) or BasicWorkspace.
- add package info (pubspec) to resolution salt.
- removed duplication of finding package_config.json from ContextLocator, as this is now done while creating workspace.
- some test/s setup/expectations were changed since we now use package config as marker for workspace instead of pubspec.
Change-Id: I091a4a686c6b1d8c14858aefd9843a8d9c8efa25
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345346
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Before this change, the analyzer supported analyzing legacy code if
the (somewhat confusingly named) global variable `noSoundNullSafety`
was set to `false`. This was used to support legacy code while google3
was still migrating to null safety.
Now that the internal migration process is complete, the analyzer no
longer needs to support legacy code. As a first step in removing that
support, this change removes the `noSoundNullSafety` flag and all the
unit tests that made use of it.
From this point forward it will not be possible to use the analyzer to
analyze code that has a Dart language version less than 2.12.
Change-Id: Idce4b271d1cfc43d25251b7a899259d62b421caf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/345365
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Noteworthy:
* deprecates the `sdkVersionConstraint` getter and updates uses
* migrates tests for sdk contstraints in the absence of a pubspec from context_builder_test to analysis_context_collection_test
* makes `pubPackages` getter broadly visible
Next step: remove the code that sets the `sdkVersionConstraint` in the analysis options object and remove the getter.
Change-Id: I443cdd15ec8d28ac6fa6786e06c1e4b027eee747
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Fixes https://github.com/dart-lang/sdk/issues/54038
The main feature is a small expansion to what is allowed in the `flutter / assets` field. We used to enforce that the `assets` field is a list, and that each value is a string. Now we enforce that:
* the `assets` field is a list
* an asset is either a string, or
* an asset is a map, with at least a 'path' key, with a string value.
This requires deprecating the `ASSET_NOT_STRING` code, and introducing
three others:
* ASSET_MISSING_PATH
* ASSET_NOT_STRING_OR_MAP
* ASSET_PATH_NOT_STRING
In addition I cleaned up a UX issue: Several codes referenced an 'asset' key, but it should be 'assets'. (In addition, the `ASSET_FIELD_NOT_LIST` code should be `ASSETS_FIELD_NOT_LIST` but I did not fix that.)
I also refactored all of the code to be more modern:
* Use `var` instead of types in declarations
* Short circuit error-and-return with `if (foo is! YamlMap)`. We didn't use to have promotion here, but this led to a wild amount of nesting (if, if, for, if, if, else, if!).
Change-Id: Ia489ea631f7d1027fdb84a9a682c831752c5835c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338593
Reviewed-by: Marya Belanger <mbelanger@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
I also cleaned up a bunch of places that referred to them.
Change-Id: I45f68818c892f8620ea04257885ffa3763374bb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335863
Auto-Submit: Bob Nystrom <rnystrom@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Alexander Thomas <athom@google.com>
Deprecate accessing LineInfo, Source, or SourceRange via the
old library (pkg/analyzer/lib/src/generated/source.dart).
Migrate all SDK code to the new library.
Fixes https://github.com/dart-lang/sdk/issues/46420
Change-Id: Ic7c98a5820415c92a457f9fa2756351b05520cd1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335382
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
This migrates the bulk of the calls to `.analysisOptions`. I'll tackle the remainder in a few follow-ups.
Change-Id: I0f4c78d88938feecaba7202e0dc299dc17e2bb35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334647
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Phil Quitslund <pquitslund@google.com>
This is a reland of commit 18c8a50557
Original change's description:
> add a `file` property to `FileResult`s
>
> Change-Id: Ibec62da4552da3124d85f6020f4e8e1dac8a757b
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/333588
> Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
> Commit-Queue: Phil Quitslund <pquitslund@google.com>
> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Change-Id: Ia6e04cdf73e55c100fe5e2b5b6678f1c6bffc327
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/334361
Commit-Queue: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Contains quite a bit of refactoring. One big change is that `PubspecValidator.validate()` now also finds lints. Not sure we want this, but it seemed desirable to me. (Otherwise there was no central place to filter the lints through the ignores).
Change-Id: Ic8a463a9718fb29bec0d4f7e849b6da7799aebc6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/311980
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Change-Id: I582f956cd4b712203c2f6dd630b4e1384040446d
Tested: analysis clean (this is a lint only related change)
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329400
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
Unclear, if this was intentionally written as classes.
It just seemed confusing to me. Since the classes were essentially
functions that had some of their arguments passed in the constructor
and some of their arguments passed in a method call.
It also seemed impossible to reuse the actual objects.
Change-Id: I56b341ee4851d24b9d176857a53b96f7eb941335
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317883
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Some of the tests would write file paths (instead of URIs) into package_config.jsons, and another assumed memory usage of Dart processes was always low enough that the Memory column header would not be padded with extra spaces to account for wider numbers.
Change-Id: I630aa62a81e20502dc51667893ce099d01a7fad6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/307302
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Fixes#51095
TEST=ci
CoreLibraryReviewExempt: There are no API changes, just removal of superfluous words in the comments.
Change-Id: Ib1020c62fe6baed5ca68f0074323f025cc90e9f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/279500
Reviewed-by: Lasse Nielsen <lrn@google.com>
Commit-Queue: Lasse Nielsen <lrn@google.com>
Reviewed-by: Siva Annamalai <asiva@google.com>
No changes to implementation yet, we still look for both Blaze and Bazel.
Bug: https://github.com/dart-lang/sdk/issues/49629
Change-Id: Iaf1b1cc2c9a8cf28d8bbfb5541819a1f5c8a3de6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254343
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>