Commit Graph

1240 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
FMorschel bda52677b5 [DAS] Adds assist to "Add type name" on dot-shorthands
Fixes: https://github.com/dart-lang/sdk/issues/61984
Change-Id: I2e2599a4ef67fa0d25f28d3e7ff60f1519f00815
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472260
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-17 15:21:29 -07:00
Sam Rawlins 93f0b191b1 linter: Report more use_super_parameters cases where named can be converted
https://github.com/dart-lang/sdk/issues/58729

Change-Id: I257b89580fb31fcd21f9a33d3094dc3cb25063d7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/477583
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-04-17 12:45:29 -07:00
Brian Wilkerson d75661c6d8 Update convertToSuperParameters to support primary constructors
This CL is a bit different from many previous CLs in a couple of ways.

The smallest difference is that I realized that some of the logic could
be shared and that we have a utility method that just need to be
enhanced a bit to support primary constructors. At some point we should
go back to the previous implementations and update them to use the
utility method.

The larger difference is the use of a pair of wrapper classes to
encapsulate some of the differences between primary and secondary
constructors. I'm not sure how I feel about the two approaches. On the
one hand, the wrapper classes feel a bit heavy-handed, but on the other
hand they could make a lot of code more DRY.

Your thoughts would be appreciated.

Closes https://github.com/dart-lang/sdk/issues/63047

Change-Id: I93af6d2a529bbc0491cf64ff03f7a58e6b874d81
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495461
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-16 09:33:18 -07:00
Danny Tuppeny 4f99b5b870 [analyzer_plugin] Default parameter name for setters to value
Change-Id: Id20717cba30f85486bd3ed41278efea222fd8b4c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495400
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-04-14 10:58:43 -07:00
Danny Tuppeny e0e7580510 [analysis_server] Update Encapsulate Field to handle declaring parameters
Fixes https://github.com/dart-lang/sdk/issues/63145

Change-Id: I6a7857d62f50a5b27968fca120ee7337f22a551f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494121
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-09 14:52:11 -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
Danny Tuppeny 08f8d4fc7f [analysis_server] Use writeFunctionDeclaration in a few more places
Change-Id: I11f1750281693ee12e7eec6b8fa54cb62dd41cc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492820
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-04-07 09:02:13 -07:00
Danny Tuppeny 5a33794a61 [analysis_server] Switch to using writeFunctionDeclaration in more places
Change-Id: I90bcb2adbca247f83aa642cffaeaead6a0a7e429
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492600
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-04-06 09:57:37 -07:00
Danny Tuppeny 0d7653976b [analysis_server] Handle inserting into empty bodies for create_extension_member, create_missing_overrides
Fixes https://github.com/dart-lang/sdk/issues/63051
Fixes https://github.com/dart-lang/sdk/issues/63056

Change-Id: Idfeb469fad62b090603e3f4a9657f6ee158f4bfc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492121
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-04-01 13:32:29 -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
D.ildo 7cad9ad43d #62878 quick fix incorrectly treats positional arguments
Closes https://github.com/dart-lang/sdk/pull/62921

GitOrigin-RevId: 5f21333b6fc53b56897ab2a83e9aa8638911a56a
Change-Id: Ie24702e8e7b1eda21b34f9972f02fd94387dc1f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488525
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-03-20 07:51:50 -07:00
Sam Rawlins ed36a5a057 analyzer_plugin: Use if-case in generated code to extract Map values
This avoids a second Map access for retrieving every value in every
message from a plugin.

This also extracts out the `if (json is Map)` case outside of a block,
by short-circuiting when `json` is not a Map.

Change-Id: I962511d44ea797a0105901510a9182b5811b0230
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487080
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-03-19 09:29:00 -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 e655e9fd6c DeCo. Add ClassBody.members, EnumBody.constants, EnumBody.members
Add `ClassBody.members` and `EnumBody.constants`/`members` so callers
can access class and enum contents through the common body interfaces
instead of pattern matching on `BlockClassBody` and `BlockEnumBody`.

Implement empty node lists for empty class and enum bodies, update the
public API, and migrate analyzer, analysis_server, analyzer_plugin, and
linter code to use the new accessors directly. This removes the ad hoc
`members2` helper extensions and a large amount of repeated `tryCast`
and `switch` logic, making body traversal more uniform.

Change-Id: I51d75f2253c7e6f75efecae84bf0443ff5eb6788
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/488263
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-03-16 19:29:20 -07:00
Sam Rawlins 7d0a17196c DAS plugins: Add print-debugging support in Insights pages.
Work towards https://github.com/dart-lang/sdk/issues/61868

This adds a new notification type, 'PluginPrint'. There are several
fields and variables then named 'pluginPrint' or 'print', and I am
definitely open to changing these names, but this is the best one that
I thought of.

PluginPrint has three fields: The name of the plugin that printed, the
message that was printed, and the timestamp.

We wrap each plugin's AnalysisRule invocations with a zone, so that
the `print` handler can know the name of the plugin. The prints are
caught and sent to the server isolate as Notifications. The
PluginIsolate then stores the collected prints. The Plugins Insights
page can then retrieve them and display them.

Manual testing, with 1000 libraries that get new lint reported once per
file, I did not observe a negative performance impact.

Change-Id: Id800ae41781c15ce89d06b563878c2b0edae43d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486827
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-03-16 14:56:59 -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
Danny Tuppeny 87e0fea473 [analysis_server] Don't let format errors fail change building
Some refactors try to format their code, but formatting can fail if there is a parse error anywhere in the file (including in completely unrelated code). This change catches formatting errors and ignores them, so the refactors will continue to work in that case (albeit without formatting).

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

Change-Id: Ia3c3769640314557191244393ab8c1bd38dc2fdb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487841
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-03-14 07:27:50 -07:00
Danny Tuppeny 7bd7595cfa [analysis_server] Use the minimum of SDK language version and formatter version for formatting
This allows the formatter to be both ahead or behind the SDK version and still format correctly. We should not use a newer language version than the SDK is using, and we cannot use a newer version than the formatter supports.

Change-Id: I5ef27363d213f570b2eb0d3b428752aef8e76af1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487580
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-03-13 14:42:03 -07:00
Brian Wilkerson b54f4b718e Support primary constructors for the addKeyToConstructors fix
Change-Id: I74a07d76c4e874dd1cc2ecaffe0f6a5a994a746e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487221
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-03-12 08:57:25 -07:00
Danny Tuppeny 4a4658e014 [analysis_server] Pass experiments through to formatter
This passes any experiments that are both enabled, and marked as "future" through to the formatter.

I extracted most uses of the formatter to use the same shared `createFormatter()` helper that sets the appropriate values. Those that didn't already have a Result to pass I added TODOs to (though one is g3 so probably would require some internal migration).

See https://github.com/dart-lang/sdk/issues/55125

Change-Id: I8f4ef4242614dc240e217cdaf99105f2a5b49dc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/486840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-03-10 12:46:31 -07:00
FMorschel 72c417c133 [DAS] Fixes dot shorthand completions when feature is disabled
Fixes: https://github.com/dart-lang/sdk/issues/61983
Change-Id: Id5901b1094e2d9b18bc2ab3c279ddc94f6063eb3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472020
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-03-04 10:51:41 -08: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
Danny Tuppeny 0b2961da1f [analysis_server] Update Go-to-Definition for factory keyword
Change-Id: I76b23e549d20a0716df6b43b091976e54774f922
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483541
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-02-25 07:53:36 -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
FMorschel 1f8861f4f9 [analyzer_plugin] Fixes recursive type writing on DartEditBuilder.writeType
Fixes: https://github.com/dart-lang/sdk/issues/62549
Change-Id: Ia5f8b7cf7f923d63a73a9b155d1590052a61eaa5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476800
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-02-23 09:06:48 -08:00
Danny Tuppeny 2a375317f4 [analysis_server] Deprecate HighlightRegionType.BUILT_IN and always use KEYWORD
Change-Id: I86ff7edc2b4de5910b19f6bdb0d4422b7546897a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482820
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-02-23 07:44:32 -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 02ced6c1a5 [api_summary] Fix member sort order.
Fixes two minor bugs with the sorting of members in the API summary
tool:

- The technique for placing getters next to their corresponding
  setters was to sort them lexicographically based on
  `Element.apiName`, which in the case of setters appends `=`. This
  mostly worked, but due to the fact that `=` is between `9` and `A`
  in ASCII, it was wrong in a few corner cases. For example, it would
  sort `x`, `x=`, `x1`, and `x1=` in the order `x`, `x1`, `x1=`,
  `x=`. Fixing this didn't affect any `api.txt` files in practice.

- The technique for sorting constructors also used `Element.apiName`,
  which in the case of an unnamed constructor is `new`. This meant
  that if a class had both named and unnamed constructors, the unnamed
  constructor would not always be sorted before the other
  constructors.

The fix for both bugs is to sort by `Element.name` (which does not add
`=` for setters and is the empty string for unnamed constructors), and
then to break ties by explicitly checking whether the element is a
setter.

Change-Id: I6a6a69648fb5915266a9111c5d884531bba4405d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/482361
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2026-02-20 10:43:16 -08:00
Danny Tuppeny 48849fa255 [analysis_server] Expand tests for Go-to-Definition for new() constructors
Change-Id: I9ce8c22730369d921eb3b0ecaed75ab6b7eb1a10
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481803
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-02-19 07:51:24 -08:00
Konstantin Shcheglov 41b05c8984 CQ. Rewrite identifiers resolving to types into TypeLiteral nodes
Modify the AST rewriting phase to transform `SimpleIdentifier` and
`PrefixedIdentifier` nodes into `TypeLiteral` nodes when they resolve to
a type (such as classes, type aliases, `dynamic`, or `Never`) and appear
within a value expression slot.

This change ensures a more consistent AST representation where type
references used as values are distinct from other identifiers.

Key changes include:
- Generating `isInValueExpressionSlot` methods for AST nodes to identify
  valid contexts for type literals.
- Updating `AstRewriteVisitor` to perform the conversion.
- Adjusting constant evaluation, completion, and linter rules to support
  `TypeLiteral` nodes in expression contexts.
- Adding comprehensive resolution tests for type literals in assignments,
  conditionals, loops, and other structures.

Change-Id: I248481dc9c940dfc0cbea4950b918d2e0a3d9bb6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/479780
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-02-18 12:05:17 -08:00
FMorschel 30383e0ee2 [DAS] Fixes rules links for non-lowercase rules
Fixes: https://github.com/dart-lang/sdk/issues/62703
Change-Id: I4371edac64738fceb1725bea13d539bbf78247af
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/481400
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2026-02-18 07:31:31 -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
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
Jake Macdonald 39eba46d91 add presubmit checks for sorting, support only checking changed files
BUG: https://github.com/dart-lang/sdk/issues/52064
Change-Id: Ie45f22cbfb9f97018ba2bf6256f1470abc95a220
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/476980
Commit-Queue: Jake Macdonald <jakemac@google.com>
Auto-Submit: Jake Macdonald <jakemac@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-02-02 08:18:20 -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 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
Bogdan 606975ee96 [analysis_server] Add document links for plugins in analysis_options.yaml
Closes https://github.com/dart-lang/sdk/pull/62493

GitOrigin-RevId: 6fc5b1be2f40e9374173d20ef5646c781a65ec65
Change-Id: I147c5b4843d1e3437b9212ce6e66ca7285229621
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/475422
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-01-26 14:25:28 -08:00
Danny Tuppeny eb174b33a7 [analysis_server] Support primary constructors in navigation
Change-Id: I2182d58e792eae85c60ff145196c90affcb32085
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/474820
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-01-22 09:00:39 -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
Konstantin Shcheglov 98d0db74e8 CQ. Use tryCast() instead of ifTypeOrNull().
Change-Id: I2a13f6b3a56c045cc35944360bc5a76894acf03f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/472480
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-01-13 09:41:53 -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