Commit Graph

137 Commits

Author SHA1 Message Date
Konstantin Shcheglov 84ce4ba3df Start analyzer 13.1.0-dev, analyzer_plugin 0.14.10-dev, analyzer_testing 0.2.7-dev, analysis_server_plugin 0.3.16-dev
Change-Id: If445461ac9c3fca85656c69d66fb5e99a5d2e339
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497380
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-22 12:36:09 -07:00
Konstantin Shcheglov f2c40f98fd Prepare to publish analyzer 13.0.0, _fe_analyzer_shared 100.0.0, analysis_server_plugin 0.3.15, analyzer_plugin 0.14.9, analyzer_testing 0.2.6
Change-Id: I67692af1ed67a50b55ba1e7a5d907f85e6572040
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497342
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-04-22 11:38:06 -07:00
Konstantin Shcheglov 6cd3938741 Breaking changes for analyzer 13.0.0
https://github.com/dart-lang/sdk/issues/62799
https://github.com/dart-lang/sdk/issues/62944
https://github.com/dart-lang/sdk/issues/63002
https://github.com/dart-lang/sdk/issues/62970

Looks mostly green in google3: https://fusion2.corp.google.com/presubmit/901021300/OCL:901021300:BASE:901308428:1776439417713:37cd1695

Change-Id: I44754a48f66a0b58851d7c20fcfa61f7fb1b555a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488624
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-17 23:06:25 -07:00
Konstantin Shcheglov 7ecd14fb10 Start analyzer 12.2.0-dev, analyzer_plugin 0.14.9-dev, analyzer_testing 0.2.6-dev, analysis_server_plugin 0.3.15-dev
Change-Id: I426a42588163b3e3680fea80ff7965ca7d076eb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493920
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-08 13:06:30 -07:00
Konstantin Shcheglov 1b3b1a154f Prepare to publish analyzer 12.1.0, _fe_analyzer_shared 99.0.0, analysis_server_plugin 0.3.14, analyzer_plugin 0.14.8, analyzer_testing 0.2.5
Bug: https://github.com/dart-lang/sdk/issues/63113
Change-Id: I58a32cfd25dfdd4663aefa79ddaa64dda67d486a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493481
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-08 10:54:40 -07:00
Konstantin Shcheglov 23e558876a Start analyzer 12.1.0-dev, analyzer_plugin 0.14.8-dev, analyzer_testing 0.2.5-dev, analysis_server_plugin 0.3.14-dev
Change-Id: Ib0971736635e507fbd1cc4a214ccba8beea83639
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/490346
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-03-24 17:03:40 -07:00
Fedor Shcheglov fe0bdac54f Fix a bug where augmentation was incorrectly associated with the macro feature, rather than the augmentations feature.
Added additional tests to ensure validity of this change.

This didn't cause issues in unit tests, because all of them had macros
enabled in their superclasses.

Add TODO for named mixin applications: mixin application classes can't
be augmented.
(https://github.com/dart-lang/language/blob/main/working/augmentations/feature-specification.md#augmenting-class-like-declarations)

Change-Id: Ieaaec84d16ca8cf6d103c9c905fdfa2c0b7c8ca1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/489680
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-03-23 07:26:18 -07:00
Ben Konyi 2a83a78213 [ DAS ] Add initial support for widget preview detection service
The Flutter Widget Preview feature is currently implemented within
Flutter Tools, which is responsible for detecting widget preview
annotations in the user's project. When previews are detected, the
Flutter Tool injects code generated based on the detected previews into an artificial widget_preview_scaffold project and performs a hot reload to render updates to the preview set in the scaffold application.

`package:analyzer` is currently being used to detect previews, but this comes with a significant amount of memory overhead. Since widget
previews are mostly being used from within IDEs which already have an
active analysis server, moving widget preview detection into the DAS
will remove the need for creating an additional analysis context in the Flutter Tool itself.

This change includes the initial work to move widget preview detection
into the DAS. It utilizes a pull-based mechanism, where the Flutter Tool listens for file system events and then queries the DAS using the `dart/textDocument/getFlutterWidgetPreviews` and `dart/workspace/getFlutterWidgetPreviews` LSP methods.

Each reported preview contains some generated code based on the annotation used to define the preview. This code has all constants from the original annotation evaluated to either primitive values or constant expressions with namespaces applied to each symbol, allowing for the Flutter Tool to inject this code directly when updating the generated code in the scaffold project.

Towards https://github.com/flutter/flutter/issues/179584

Change-Id: I043cb3235a66b25dda3f852ca7f147bff0e1e537
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/478100
Auto-Submit: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-03-22 19:19:03 -07:00
Konstantin Shcheglov ea94b269d1 Prepare to publish analyzer 12.0.0, _fe_analyzer_shared 98.0.0, analysis_server_plugin 0.3.13, analyzer_plugin 0.14.7, analyzer_testing 0.2.4
Change-Id: Ia46a1ba04db30a15d8848e8e1586795921a33ed1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488241
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-03-16 19:32:20 -07:00
Konstantin Shcheglov e9d8109258 DeCo. Support empty bodies in membered declarations
Allow enums, extensions, and mixins to use `;` as their body and
represent that form explicitly in the AST. The parser now produces
`EmptyEnumBody` or `EmptyClassBody` for the empty form.

Also replace `LibraryIdentifier` with token-based `DottedName` and store
the full token sequence for dotted names. This preserves periods and
source offsets directly in the AST, which keeps printing, selection, and
directive name handling working with the new shape. See
https://github.com/dart-lang/sdk/issues/62819

See https://github.com/dart-lang/language/issues/4645

Google3 presubmit looks green:
https://fusion2.corp.google.com/presubmit/884063020/OCL:884063020:BASE:884079610:1773618867493:b2110d76

Change-Id: I2d023cd03b6423da634c3e14742e02a61dc3b403
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
2026-03-16 08:56:11 -07:00
Konstantin Shcheglov 2e6153cdb6 Start analyzer 11.1.0-dev, analyzer_plugin 0.14.6-dev, analyzer_testing 0.2.3-dev, analysis_server_plugin 0.3.12-dev
Change-Id: Iddeffba7499ea1b1bcd607bf72ad9766a997ae74
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484501
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-03-02 10:53:00 -08:00
Konstantin Shcheglov e819fffbd1 Prepare to publish analyzer 11.0.0, _fe_analyzer_shared 97.0.0, analysis_server_plugin 0.3.11, analyzer_plugin 0.14.5, analyzer_testing 0.2.2
Change-Id: Ibfa9fa0db341a9335bf5983375e15212717b6b5a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484220
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-02-27 10:52:00 -08:00
Konstantin Shcheglov 19895724dd Breaking changes for analyzer version 11.0.0
Change-Id: I75c4dca69a99c0129cc8ae6934d5925382228a00
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481542
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-02-24 14:36:29 -08:00
Konstantin Shcheglov 5cbe70416f Start analyzer 10.3.0-dev, analyzer_plugin 0.14.5-dev, analyzer_testing 0.2.2-dev, analysis_server_plugin 0.3.11-dev
Change-Id: I5fecb1813aebf0be764f41f270ae26a0de4dcc17
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482600
Reviewed-by: Paul Berry <paulberry@google.com>
2026-02-21 10:52:57 -08:00
Konstantin Shcheglov 777b6efcd9 Prepare to publish analyzer 10.2.0, _fe_analyzer_shared 96.0.0, analysis_server_plugin 0.3.10, analyzer_plugin 0.14.4, analyzer_testing 0.2.1
Change-Id: Id5f874b59e441c81910d979d9f50e4415674179d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482363
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-02-20 12:59:46 -08:00
Paul Berry dca8eb4ae6 [API summary] Consider publicly exported names to be part of public API.
Changes the logic for deciding whether to output details about a top
level element. Previously, details would be output if the library
containing the element's declaration was in `lib` but not
`lib/src`. This led to a bug: if a top level element was declared in
`lib/src` but exported by an `export` directive in `lib`, no details
would be output, and the API summary would just show `(non-public)`
after the exported name.

This bug was mostly benign because we were working around it with an
analyzer-specific hack: when analyzing the `analyzer` package, top
level elements with an annotation of type `AnalyzerPublicApi` would
have their details output regardless of where they were declared. But
it wasn't completely benign: the tool was failing to output details of
`DartDocumentLinkVisitor` and `DocumentLink` (from
`package:analyzer_plugin`), as well as `PackageBuilder` (from
`package:analyzer_testing`).

The new logic is: details are output if the element appears in the
export namespace of any library in `lib` but not `lib/src`. I've
re-run the API summary tool so the `api.txt` files in
`package:analyzer_plugin` and `package:analyzer_testing` now include
the details they were missing.

The analyzer-specific hack is left in place, though, because there are
some analyzer classes that aren't exported, but still considered part
of the analyzer public API. In a follow-up CL, I will make the API
summary tool extensible so that this analyzer-specific logic can be
injected by the analyzer when generating its `api.txt` file, and it
won't pollute the incipient `api_summary` tool.

Change-Id: I6a6a69641d656caa4f8e6361557c13fa7485e422
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482440
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-02-20 11:21:15 -08:00
Paul Berry c6a9c9536e [api_summary] Add class modifier support.
Adds the modifiers `abstract`, `base`, `final`, and `interface` to the
API summary output.

This information is an important part of the public API of a package,
because it determines whether a client can:

- Construct an instance of the class,
- Extend the class, or
- Implement the class.

Change-Id: I6a6a6964ba07db1714bc2fcb549cc15230e87058
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482362
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-02-20 10:49:45 -08:00
Paul Berry 016ea28ede [api_summary] Add unit tests.
These tests cover all the functionality of the API summary tool.

Note that since the `ApiDescription` constructor requires an
`AnalysisContext`, I added a public `contextCollection` getter to the
`PubPackageResolutionTest` base class.

There are a few loose ends I intend to address in follow-up CLs. They
have been noted in TODO comments:

- Annotate when classes are `abstract`, `final`, or `interface`.

- Move `pub_package_resolution.dart` out of
  `package:analyzer_testing/src` (so that when I publish this as a
  separate package, that package won't be dependent on private
  implementation details of `package:analyzer_testing`).

Change-Id: I6a6a69643064115997f6586ff5161ddf4c9f96ff
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482360
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-02-20 10:41:40 -08:00
Paul Berry e2c31151a5 [analyzer_testing] Sort declarations in pub_package_resolution.dart.
Change-Id: I6a6a69649bba8bebde0d8b89df08660fefd1555f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482121
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-02-19 18:40:21 -08:00
Robert Nystrom c82716b216 Enable "private-named-parameters" experiment flag.
TEST=many language, co19, and other tests

Bug: https://github.com/dart-lang/sdk/issues/61629
Change-Id: I24d761cc2dc3fa2707a2486a39bfde1b8e847b1e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480384
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Morgan :) <davidmorgan@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Bob Nystrom <rnystrom@google.com>
2026-02-18 15:26:18 -08:00
TejasSojitra12 fb04feed13 [analyzer_testing] Add missing Flutter mock types
Adds MediaQuery, RichText, Wrap, and Sliver classes to the Flutter package mock.

Fixes #62559

Change-Id: If2f41fba8a12bdaf3d1a14eadb516eb13cc2d609
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/477620
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-02-18 10:03:59 -08:00
Paul Berry dfd26d463c [messages] Move AbstractAnalysisRule class hierarchy into src.
Moves the following classes from
`package:analyzer/analysis_rule/analysis_rule.dart` into
`package:analyzer/src/analysis_rule/analysis_rule.dart`:

- `AbstractAnalysisRule`
- `AnalysisRule`
- `MultiAnalysisRule`
- `RemovedAnalysisRule`

These classes are part of the analyzer public API, so the file
`package:analyzer/analysis_rule/analysis_rule.dart` remains, exporting
the declarations so that they can still be used by clients.

This paves the way for a follow-up CL that will use extensions to add
functionality that we *don't* want to include in the analyzer public
API yet.

Change-Id: I6a6a696431f00f69b4b80e0d98b1b8fbb33f020f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481164
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-02-17 14:35:19 -08:00
Konstantin Shcheglov d3d0ec9f66 Start analyzer 10.2.0-dev, analyzer_plugin 0.14.4-dev, analyzer_testing 0.2.1-dev, analysis_server_plugin 0.3.10-dev
Change-Id: I99ed03bc272bf6c243438b41b69c78dbf5511427
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481240
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-02-17 10:53:10 -08:00
Konstantin Shcheglov fc41bfcf92 Prepare to publish analyzer 10.1.0, _fe_analyzer_shared 95.0.0, analysis_server_plugin 0.3.9, analyzer_plugin 0.14.3, analyzer_testing 0.2.0
Change-Id: Ibe306aceaf6967a978fbf7e8bad07c3475e8ca10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481060
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-02-17 09:20:42 -08:00
Paul Berry 2b5e655c34 [messages] Fix test failure output.
Changes the test logic in `analysis_server` and `analyzer_testing` so
that after printing `To accept the current state, expect:`, it prints
diagnostic codes in their proper camelCase format.

Also removes some bogus code from
`pkg/analyzer_testing/lib/analysis_rule/analysis_rule.dart` that
erroneously suggested passing a `name:` parameter to the top level
`error` function. This function does not accept any parameter called
`name`.

Previously, only tests in `pkg/analyzer/test` printed the diagnostic
codes correctly.

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

Change-Id: I6a6a6964b17cf798c1355e09f9a4633e1fbe388c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480041
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-02-12 10:15:31 -08:00
Paul Berry 599f4bf94e [messages] Move string extensions into analyzer_testing.
These extensions were previously in `pkg/analyzer_utilities`, which is
not published on `pub`. That meant they could not be used from within
the `lib` directory of any package that *is* published on
`pub`. Specifically, they could not be used from within
`pkg/analyzer_testing/lib`.

In a follow-up CL, I will modify the testing logic so that after
printing `To accept the current state, expect:`, it prints diagnostic
codes in their proper camelCase format.

Change-Id: I6a6a696432d7162906b2c235ea88310dc0aa1fa9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480040
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-02-12 10:12:02 -08:00
Sam Rawlins 39f8aa4ba8 analyzer_testing: Remove old mock APIs and old mock sources
Change-Id: If0f40090eb689438598f092877f72525a9ba7325
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/477764
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-02-03 08:18:19 -08:00
Konstantin Shcheglov 98c4f54c0f Start analyzer 10.1.0-dev, analyzer_plugin 0.14.3-dev, analyzer_testing 0.1.11-dev, analysis_server_plugin 0.3.9-dev
Change-Id: I2ec7613ce0abcfa6e55f8c7837860319d9503adf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/477641
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-02-02 11:54:49 -08:00
Sam Rawlins 94a701bb0a Bump analyzer to 10.0.2, analyzer_plugin to 0.14.2, analyzer_testing to 0.1.10, and analysis_server_plugin to 0.3.8
This release is so we can publish a version of analysis_server_plugin,
and then start depending on that published version in DAS.

In addition, we get a highly requested fix out to analyzer_testing
users.

Change-Id: I694f47aeee59367c1fc066bc8f7a865406b09917
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476620
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-01-30 09:24:57 -08:00
Sam Rawlins 1c87e41254 analyzer_testing: Flip to new flutter mock sources
Fixes https://github.com/dart-lang/sdk/issues/61597

* Remove the old caching mechanism for the old way of sourcing files.
* Remove BlazeMockPackages._addFiles, and rename _addFiles2 to
  _addFiles.

A few trailing fixing included:

* Flex.new has a required direction parameter.
* TextOverflow comes from
  'package:flutter/src/painting/text_painter.dart'.
* A few stray imports needed to resolve types.
* DiagnosticableTree.debugDescribeChildren is marked external so
  that subclasses need not implement it themselves.
* In sort_child_properties_last, RawMaterialButton is in the material
  library.

Change-Id: I092bad587ea39bceb7af0951eada3963b1eb48bb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/473542
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-29 08:59:08 -08:00
Sam Rawlins dfdb1f9f72 analyzer_testing: Add imports to resolve more types in mock flutter; add missing components
Work towards https://github.com/dart-lang/sdk/issues/61597

Change-Id: I40c323f118bb7e9cf2394a5146ba4147098bce92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476151
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-01-29 06:18:50 -08:00
Sam Rawlins ae41760d93 analyzer_testing: Add many imports and some elements to flutter mocks;
Work towards https://github.com/dart-lang/sdk/issues/61597

* DiagnosticsTreeStyle is used just below in DiagnosticsProperty.
* BoxConstraints is used in the `flutter_completion_benchmark`.
* Constraints is the superclass of BoxConstraints.
* The vector_math export is so that a few tests have access to the
  Matrix4 class.
* FutureBuilder and StreamBuilder are needed for the
  flutter_wrap_builder correction producer.

All of these changes bring the mocks/stubs closer to the real sources
(none are a divergence).


Change-Id: I80d746db3372417d7125aa1f3c2b0604a143f43b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476144
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-28 12:58:49 -08:00
Sam Rawlins be20f9421c analyzer_testing: prepare for abstract State.build method
Work towards https://github.com/dart-lang/sdk/issues/61597

State.build is abstract in the real flutter sources; making our stub
version of State the same allows it to be generated, and requires us
to make our tests more "real world."

Change-Id: Iff4c6e701402a83635575f3b980bf6d60b64b6d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475860
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-27 15:59:53 -08:00
Sam Rawlins d898aca90c analyzer_testing: Remove ClipRect.rect
Work towards https://github.com/dart-lang/sdk/issues/61597

Change-Id: Ib44d8a813d9a59cf7ebf2eb901140b2e9482b156
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475880
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-27 10:52:20 -08:00
Sam Rawlins 7e5885e78a analyzer: Allow awaitNotRequired on a Future-returning typedef
This includes bumping meta to 1.18.1.

To support https://github.com/flutter/flutter/issues/168555

Change-Id: I6830a413efcf9939467e97faf58b1255d2d3d8eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475760
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-26 18:14:50 -08:00
Sam Rawlins 46a8211c92 analyzer_testing: Add many missing stub members to flutter stubs
Work towards https://github.com/dart-lang/sdk/issues/61597

* I found many members of dart:ui were missing, needed generally by
  various tests, or members of package:flutter/painting.dart.
* Rename 'package:ui/ui.dart' to 'dart:ui' in a few places.
* `BoxDecoration.color` is nullable.
* `BoxDecoration.backgroundBlendMode` is a `BlendMode?`.
* Add the inherited_theme.dart library, with InheritedTheme, needed by
  other text widget classes.
* Add MultiChildRenderObjectWidget as a missing parent class.
* Add concrete implementations to many `State` members. In the real
  State class, these are concrete, and we have tests with concrete
  subclasses of State, without overrides of these members. So the State
  members themselves must be concrete.
* Add new classes: ParentData, ProxyWidget, InheritedWidget,
  ParentDataWidget.
* In widgets/text.dart, import dart:ui as ui, and fix many type
  signatures. The real widgets/text.dart has this import prefix, and it
  makes some signatures more understandable.
* Add some doc comments to various Text members, for the
  widget_descriptions code; we have tests that use these doc comments.

Change-Id: I1e38918b4e5381a56ce29440e1181d76e9d56f4e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475702
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-01-26 14:18:54 -08:00
Sam Rawlins 97826545ea analyzer_testing: export Size from painting/basic_types.dart
With these new exports, we have a lot of "unnecessary import" warnings
in our tests.

As we move to generating these stubs, they will stick closer to their
real counterparts, and include exports like these.

Change-Id: Id63eec30f3a33c8c9751cbf1f213f8d4bf3c41d2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475501
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-24 19:28:41 -08:00
Sam Rawlins f0c737d6c2 analyzer_testing: Widget is @immutable
This requires some changes to tests, where fields should be final. In
tests where it seemed like the mutability of a field was important, I
just ignored the warning. Otherwise, I made fields final.

I do like keeping this stub in-line with the real Widget class. If
anything, it keeps in mind that flutter Widgets should generally no
have mutable fields.

Change-Id: Ib7dc1fbd6aa013dc72925404c4be8186ddcddaa4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475400
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-23 12:25:21 -08:00
Sam Rawlins 99ce676aaa analyzer_testing: DefaultTextStyle.new has a required "style" parameter
Change-Id: Idee2108dd99fa36ddc6e7dccd2a4e1d6f6d6305f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475128
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-01-22 18:26:42 -08:00
Sam Rawlins 3bc6a133fe analyzer_testing: Use real color values in flutter package mocks/stubs
Work towards https://github.com/dart-lang/sdk/issues/61597

First, it doesn't really look any harder to test with the real color
values, and second, when we generate these stubs, it will certainly
be harder to track which constant values and constructor calls we
change.

Change-Id: Ib8255d1c92bd661dbe379978f78ec64a810d864d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/474942
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-22 11:10:09 -08:00
Sam Rawlins ca475a991d Release meta 1.18.0
analyzer package now depends on new TargetKind values in meta, so we
must bump the dependency to prevent crashes.

Change-Id: Ia639b0cd67c0dc70ae03613b6b1bfd4ad552788c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/473421
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-01-15 11:41:02 -08:00
Sam Rawlins da68d458e1 meta: Introduce TargetKind.exportDirective, .partOfDirective, and deprecate .directive
Work towards https://github.com/dart-lang/sdk/issues/62366

Change-Id: I05ff73fcb5c7fdef88412213d68eb814c2ef2492
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472981
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-14 13:33:59 -08:00
Sam Rawlins 9062f80146 analyzer_testing: Deprecate the flutter_test mock; only used in two DAS tests.
Work towards https://github.com/dart-lang/sdk/issues/61597

Change-Id: I32caa38bff42ad9117829cca9be8b892da228a9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472960
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-01-14 11:03:09 -08:00
Danny Tuppeny dfd316f498 [analyzer_testing] Fix up embedded_libs paths for Windows
Fixes some broken Windows bots/tests that fail to get the correct library names. The original code wrote half-windows-half-linux paths into the file, and the backslashes in the Windows paths resulted in "Invalid escape sequence" during loading (which was not visible because of an empty catch block in `EmbeddedSdk`)

Change-Id: I02677570a4c39515603aae49d94e21bedc0b39ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472905
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-01-14 08:05:50 -08:00
Sam Rawlins 25f0d80c15 analyzer: Refactor how the mock 'dart:ui' library is discovered
Fixes https://github.com/dart-lang/sdk/issues/62234 by making the
'dart:ui' library discoverable in the same way that the real one is
discoverable: by the sky_engine _embedder.yaml file.

Coupled with this change is the motivation: the stubs are out-of-date,
with `double width` and `double height` parameters on the Preview
constructor. But this has been changed to use a `Size` object, and
`Size` is written in 'dart:ui'. So to write a test that uses `Size`, the
test now needs proper access to 'dart:ui', and we should not write
'package:ui/ui.dart' in our test cases. These changes are in
`.../lib/mock_packages/package_content/flutter/lib/src/widget_previews/widget_previews.dart`
and in `invalid_widget_preview_private_argument_test.dart`.

Change-Id: I6f608eb3e1f431ad576ba8f3572454e42a39f9f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467680
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-01-13 15:32:51 -08:00
Konstantin Shcheglov ef20543995 Prepare to publish analyzer 10.0.0, _fe_analyzer_shared 93.0.0, analysis_server_plugin 0.3.5, analyzer_plugin 0.14.0, analyzer_testing 0.1.8
Change-Id: I22aaf17a81027ac44d5f23b114ece789d66eed93
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471120
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-01-07 11:25:23 -08:00
Sam Rawlins ed640293af meta: Annotate _Literal with TargetKind.constructor
Work towards https://github.com/dart-lang/sdk/issues/62253

The removed tests are for code which is no longer related to this
warning. Reporting on an extension type or a method is the purview of
the `invalid_annotation_target` warning. I'll note this in the summary.

Change-Id: Ide349bc1e414da339b9e89da25e383859a8144a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469761
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2025-12-30 09:29:37 -08:00
Sam Rawlins 89250d64b9 meta: Annotate nonVirtual with TargetKind.overridableMember
In the analyzer, reduce our custom warning for `nonVirtual`, (largely
replaced by the existing `invalid_annotation_target` warning). The
tests for that warning are mostly covered by the existing
`invalid_annotation_target` tests, but I added a few to fill some gaps.

Otherwise, we still report a specific warning for this annotation being
placed on an abstract member, or an instance member of an extension
type.

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

Change-Id: Ibcde2f99cf53460bff636bfc8bbf07e80779a942
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/469104
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-12-23 09:47:27 -08:00
Sam Rawlins 971aa0b12a meta: Annotate visibleForOverriding and visibleForTesting with TargetKinds
In the analyzer, remove our custom warning for `visibleForOverriding`,
`invalid_visible_for_overriding_annotation` (replaced by the existing
`invalid_annotation_target` warning). The tests for that warning are
mostly covered by the existing `invalid_annotation_target` tests, but
I added a few to fill some gaps.

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

Change-Id: Ie960db6ebe007afde787f68e4b6b9f20a1835639
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/468702
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2025-12-18 12:05:43 -08:00
Sam Rawlins 2e090517db analyzer_testing: Move last flutter mocks to multi-line strings
Work towards https://github.com/dart-lang/sdk/issues/61597

Change-Id: Idbd74c5b6ef8f4f68624c790686cf8bf8b05f9a5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467441
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2025-12-10 14:58:21 -08:00