Commit Graph

11032 Commits

Author SHA1 Message Date
Brian Wilkerson 6272dd1d89 Add a design doc for document highlight
An attempt to capture some of the conclusions from recent discussions.

Please let me know if this doesn't sound reasonable or if there are
pieces I've missed (such as other exceptions to the general rule).

Change-Id: I2520a768de116be5d9a86f9cb4494dcad7d88f5c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497780
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-24 16:20:12 -07:00
Sam Rawlins 95613f5d07 linter: Report unnecessary_async for dynamic- and Object-returning functions
Fixes https://github.com/dart-lang/sdk/issues/60416

There was discussion about expanding the purview of this lint rule, and
`Object`- or `dynamic`-returning functions do not need their return
type changed, so the fix does not change that behavior.

Change-Id: I835732d6ab25dd85142f8763624eda2d9293e003
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497840
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-04-24 11:50:21 -07:00
Sam Rawlins 33648b761d DAS: Remove more unnecessary "async" keywords
Work towards https://github.com/dart-lang/sdk/issues/60416

Change-Id: I90d93b371698bd7703f6049dcdfeb994d6228729
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497841
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-04-24 10:45:17 -07:00
Kallen Tu 77cf3047a3 Dot Shorthands: Const selector chains.
I changed the parsing of const dot shorthands to parse the entire selector chain in `parsePrecedenceExpression` rather than parsing them in `parseConstExpression`. We were originally parsing the initial expression before the `.` and only flagging that as a dot shorthand which prevented any chaining on const constructors. Const expressions with chained methods/property accesses were not being flagged as a dot shorthand so we weren’t saving the context type properly which led to producing the “unknown context type” error.

Before:
```
class C {
  const new someConstCtor();
  C method() => this;
}

C c = const .someConstCtor.method();
// (const .someConstCtor) is parsed and handled as a const constructor
// (const .someConstCtor) is handled as a dot shorthand, context is
// saved on only this AST and not the outer chain.
// Then we parse the rest of the selector chain (.method())
//
// Error: No context type for (const .someConstCtor.method())
```

After:
```
class C {
  const new someConstCtor();
  C method() => this;
}

C c = const .someConstCtor.method();
// (const .someConstCtor) is parsed and handled as a const constructor.
// Then we parse the rest of the selector chain (.method())
// (const .someConstCtor.method()) is handled as a dot shorthand, context is saved for this outer node.
//
// OK. No error because we are able to retrieve the type for the
// entire dot shorthand chain.
```

Fixes: https://github.com/dart-lang/sdk/issues/63119
Change-Id: I3308d8eb7ce101466be257aba6b5448921bff136
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495560
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2026-04-24 10:40:26 -07:00
Sam Rawlins 0706afa1ef Introduce an 'analysis options page' in the insights pages.
Work towards https://github.com/dart-lang/sdk/issues/61496

This adds some "debug information" types and a method on
AnalysisOptionsImpl, so that the data can be shared into different
debug systems. Another one I'd like to implement is a command-line
view, as per https://github.com/dart-lang/sdk/issues/61496.

There is much code shared between the Contexts page and the Analysis
options page, so that goes into diagnostics.dart.

Change-Id: I054bd19ed2ca54c4b3d7d6898eba3a968c8ca209
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497320
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-04-22 13:57:30 -07:00
Brian Wilkerson 463b751717 Add new unnecessary_type_name_in_constructor lint
This adds a new lint to recommend removing the type name from secondary
constructors.

It also adds a new fix that can automate the removal.

Change-Id: Ib6bc46b4455c360732553eadea3451d7dfb874a6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/497120
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-04-21 15:12:35 -07:00
Keerti Parthasarathy a53d974caa [primary constructor]Add tests for property editor
Change-Id: I4b7592cf7a11943fa74352ab95bdce5099cf8692
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496663
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-04-21 14:20:06 -07:00
Konstantin Shcheglov 18ab2664ca Augment. Report augmentationOfMixinApplicationClass.
Change-Id: I2649f4eb96fc232727fafa16129799ef3f207e20
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494340
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2026-04-21 09:57:59 -07:00
Brian Wilkerson 78412eaeb8 Add new unnecessary_const_in_enum_constructor lint
This adds a new lint that was requested in order to support the primary
constructors feature.

This also enables the existing fix to remove the keyword and adds some
tests for the new use of the fix.

Change-Id: Iae3c86ca87a2af6abb82488e218d839a06699778
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496741
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-21 09:27:51 -07:00
Sam Rawlins 299dabac5f DAS: Enforce constant_identifier_names lint rule.
All we have to do is ignore it in some generated files, and then it
is enforced in all other lib, tool, test files.

Change-Id: I5822db725f9c632820323dd20f5d4b6554808c26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/464624
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-20 11:09:49 -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
Brian Wilkerson b5da407918 Add tests of the property editor protocols using primary constructors
Change-Id: I6ec57b240da39ba925665dba5d1ec17fe4bef691
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496380
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-17 17:24:20 -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
Keerti Parthasarathy a043789a6b [primary constructors] Add tests for data driven fixes
Change-Id: I31d8e782400ddac5b65c484dd5eb4fef9d86d88e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/496161
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-04-17 09:02:20 -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
Brian Wilkerson e049d78f97 Update more of the rename functionality to use ChangeBuilder
There's one class left to convert, as far as I know, and I have it
mostly converted, but adding `awaits` to the code causes an inconsistent
analysis exception and I don't want to wait until I've solved that
problem to land the rest.

Change-Id: Ic5f159f0703fc708119f8bfa249270cb8a853678
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495782
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-15 10:59:43 -07:00
Konstantin Shcheglov e7c6654312 Augment. Allow abstract top-level variables.
Permit `abstract` on top-level variable declarations when the
augmentations feature is enabled. Previously the parser always reported
`abstract` as extraneous at the top level, which rejected valid syntax
and dropped the modifier before later stages could see it.

Thread the abstract token through top-level field parsing, record it on
`TopLevelVariableDeclaration`, and pass it through the front-end
builders. Reorder the field callback arguments so `augment` precedes
`abstract`, matching the augmentation grammar for incomplete top-level
variables and keeping the parser, listener, and outline plumbing
consistent.

Change-Id: I680414a746b707d483e485702685c95f28a9c9ac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494564
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-14 16:12:24 -07:00
Sam Rawlins ddefff3dd9 DAS: Fix contexts page list of analysis options
Fixes https://github.com/dart-lang/sdk/issues/63167

Change-Id: I6003f12a87bf35eb013fb001e2cf6c94dbdf3094
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495462
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-14 15:18:29 -07:00
Konstantin Shcheglov 18d47a8650 CQ. Migrate all uses of SubstitutedExecutableElementImpl.from() to substitute().
Add `InterfaceType.interfaceMembers` and
`InterfaceType.inheritedConcreteMembers`, and implement them by applying
the type's substitution to the underlying element members.

This moves member instantiation to the `InterfaceType` API instead of
requiring callers to read raw element maps and wrap the results
manually. With this change, code that works with an instantiated type
can ask the type itself for the corresponding instantiated members.

Update completion, inheritance, extension resolution, and summary
reading code to use the new API and `ExecutableElement.substitute()`
instead of `SubstitutedExecutableElementImpl.from()`. This removes the
old helper, simplifies callers, and makes substitution behavior more
uniform across the analyzer.

Change-Id: I2349546d65e9745c2cdeda19ca6ff9283a5fd001
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495100
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-04-14 13:39:50 -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
Brian Wilkerson fd8527f4dc Update convertToInitializingFormal to handle promary constructors
Closes https://github.com/dart-lang/sdk/issues/63045

Change-Id: I642115ef872b72756dd584f3c820f3ae6a5cbe4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495080
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-14 10:28:21 -07:00
Keerti Parthasarathy 1d7cd927b5 [primary constructors] Add tests for remove_initializer
Closes https://github.com/dart-lang/sdk/issues/63076

Change-Id: I6d56f22d2eca99ac4ae73444098e0ad585781cb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495082
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-14 10:17:50 -07:00
Sam Rawlins fd5f7e783c DAS: skip session logger sink tests until windows bot is investigated
Change-Id: I3179f627e2c5fa02293f630a71a53de5fefeb176
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494900
Commit-Queue: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Samuel Rawlins <srawlins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-13 15:54:21 -07:00
Keerti Parthasarathy 2a3a5d7307 [primary constructors] Add tests for remove_type_annotation
Closes https://github.com/dart-lang/sdk/issues/63078

Change-Id: I4689171e5cf20adedca41e93601da4342c65eeee
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/495040
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-04-13 14:52:16 -07:00
Konstantin Shcheglov bec97e984e CQ. Use public types as inputs, cast inside on entry.
Refactor `applicable_extensions.dart` so its public entry points accept
`DartType` and `ExtensionElement`, and perform implementation casts
internally at the analyzer boundary.

Remove the `strictCasts` parameter as well. Extension applicability
always ignores casts, so the parameter only added noise to the API and
to every call site.

Update completion and fix code in analysis_server to pass public types
directly and drop imports of internal analyzer type classes. Also
centralize the cast from `ExtensionElement` to `ExtensionElementImpl`
inside the helper instead of repeating it in multiple loops.

This makes the API cleaner, keeps the public/internal split in one
place, and reduces accidental coupling to analyzer implementation types.

Change-Id: I770ee5d8788f4c4a7004a0ad18a00cc52552e3b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494802
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-13 13:48:24 -07:00
Brian Wilkerson e7136d4772 Update removeLeadingUnderscores for primary constructors
Closes https://github.com/dart-lang/sdk/issues/63077

Change-Id: Iee573f293edbaa011a1882b8b3cb110a643802fc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494582
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-12 09:07:47 -07:00
Konstantin Shcheglov c6135cbeef CQ. Rename AnalysisOptionsFile to AnalysisOptionsFileKeys.
I'd like to free this name for `AnalysisOptionsFile` data object.

Change-Id: Ie553ef30e9bef1e312e398248d66550ed289018c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494567
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-10 13:44:00 -07:00
Brian Wilkerson f62d10f40c Update the removeConstructorName fix to handle primary constructors
Closes https://github.com/dart-lang/sdk/issues/63072

Change-Id: I3391484a2693b0ec9f520353ac231ee0d9a60c7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494623
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-10 13:04:19 -07:00
Brian Wilkerson 0488d33502 Test that the makeRequiredNamedParametersFirst fix works with declaring parameters
Closes https://github.com/dart-lang/sdk/issues/63069

Change-Id: I589bfb659a4b96d7a2f029bb2dfd2e2b1ea7b9e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494565
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-10 12:39:50 -07:00
Brian Wilkerson 0e570aacd6 Test that the convertToGenericFunctionSyntax fix works with primary constructors
Closes https://github.com/dart-lang/sdk/issues/63044

Change-Id: Ia1aefa1f93a30efa7c9f2f9c4d65664fb9ceb9ea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494621
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-10 12:13:34 -07:00
Sam Rawlins f811111f80 linter: avoid_final_parameters: avoid duplicate reporting
The lint rule was sometimes reported in the same positions as the
warning.

In 'remove_lexeme_test', there were tests for removing `final` in the
lint rule case, which just needed to be moved to testing removing
`final` in the warning case. Otherwise the test cases are unchanged.

Change-Id: I3f600b9bc7846069e793e0902dcb2456e7106ab6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494163
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-04-10 10:28:42 -07:00
Danny Tuppeny 4b01d6b803 [analysis_server] In "Encapsulate Field", update references to renamed parameters in initializers
Fixes https://github.com/dart-lang/sdk/issues/63145

Change-Id: I6dd672e5ae189a023419d2c41157fa7cdc43e46b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494141
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
2026-04-10 09:05:11 -07:00
Brian Wilkerson c075592ca1 Update addSuperParameter to support primary constructors
Closes https://github.com/dart-lang/sdk/issues/63032

Change-Id: Iab1be28ebfc3f206f82e5f8832b5e355b314f480
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494300
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-10 08:20:36 -07:00
Kallen Tu 064dd37c05 [analysis_server] Primary constructors: Update RemoveConst.
Added this as a fix for `constConstructorWithNonFinalField` and `constPrimaryConstructorWithBlockBody` who both can be fixed with the removal of the `const` keyword.

Other const removal fixes with primary constructors are covered by `RemoveLexeme`. I added tests for the relevant cases.

Bug: https://github.com/dart-lang/sdk/issues/63071
Change-Id: I0b7bb5f7976fb49e38499915999fe79465e4ae1a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492880
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-09 15:09:15 -07:00
Konstantin Shcheglov e1404d8539 Split mixinClassDeclarationWithClause and mixinModifierMixinApplicationClassWithMultipleMixins from mixinClassDeclarationExtendsNotObject.
Report dedicated diagnostics for mixin classes that use a `with` clause
and for mixin application classes that use multiple mixins, instead of
folding both cases into `mixinClassDeclarationExtendsNotObject`.

This makes the reported error match the actual invalid construct. A
`mixin class` with a `with` clause does not have the same problem as a
`mixin class` that extends a non-`Object` superclass, and a mixin
application with multiple mixins is a separate restriction again.

Update the error verifier, diagnostic definitions, messages, and fix
status entries to use the new codes. Also guard `RemoveExtendsClause` so
it only offers a fix when an actual extends clause is present, avoiding
a bogus fix for diagnostics that are now reported on `with` clauses
instead.

Consolidate the diagnostic tests under a single mixin class declaration
test file and update expectations to use the more precise error codes.

The original impetus for this change was a crash in RemoveExtendsClause
quick fix.

Change-Id: I937276f37deb293ca1fecab3ff838ace45af2ec4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493865
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-09 15:01:11 -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
Keerti Parthasarathy 1f4ae4fd3a [primary constructors] Add test for remove_var_keyword
Closes https://github.com/dart-lang/sdk/issues/63080

Change-Id: I5e4c7d12b95fd23fcffff27356e5de34dc2f5f15
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494165
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-09 14:52:00 -07:00
FMorschel 188cb9a598 [DAS] Fixes stack trace in create extension member
Fixes: https://github.com/dart-lang/sdk/issues/62736
Change-Id: I59c07165308cf6aff8029eabcdcbd901328970e0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/483060
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Auto-Submit: Felipe Morschel <git@fmorschel.dev>
2026-04-09 14:28:22 -07:00
Kallen Tu 9fee4af302 [analysis_server] Primary constructors: Update RemoveEmptyConstructorBody.
Added support to the `RemoveEmptyConstructorBody` fix to handle primary constructor bodies.

```dart
class C(int x) {
  this : assert(x > 0) {}
}
```

becomes

```dart
class C(int x) {
  this : assert(x > 0);
}
```

Fixes: https://github.com/dart-lang/sdk/issues/63075
Change-Id: I00bc80711ee436c0132a3ae5313763073b030aac
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/492883
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
2026-04-09 13:40:14 -07:00
Brian Wilkerson 077ff75a4f Update addMissingParameter to handle primary constructors
Closes https://github.com/dart-lang/sdk/issues/63029

Change-Id: I0d1a1c41864a064b7f92c7668188dc86617e0547
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494180
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-09 12:38:35 -07:00
Keerti Parthasarathy 89e73d0d66 [primary cosntructors] Add test for remove_var
Closes https://github.com/dart-lang/sdk/issues/63081

Change-Id: Iab5ec7785797527d4bca5ec3f2b4cbfcb081325f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494162
Commit-Queue: Keerti Parthasarathy <keertip@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-09 12:35:50 -07:00
Danny Tuppeny accf6cab36 [analyzer] Remove old notifyDeclarationsTracker code
This also removes an additional call to `analysisDriverScheduler.notify()` on every file modification, which triggered an "analyzing" status message, which if written to disk inside the workspace could cause an infinite loop of analyzing messages.

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

Change-Id: I4523125305807d42861a98fcc78df18ae3e8c1f0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/484760
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2026-04-09 11:48:03 -07:00
Brian Wilkerson db8ff93f32 Update make-field-not-final to handle declaring parameters
Closes https://github.com/dart-lang/sdk/issues/63066

Change-Id: Ice0ef6fb57af9042ddf97e8d65bbe68f0c32d34f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493864
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2026-04-09 10:22:46 -07:00
Brian Wilkerson 2d13c5e1ee Associate a fix with primaryConstructorBodyWithExpressionBody
Change-Id: I35e478d4456732840cb37bca45cdab624592d394
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493962
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-04-09 10:21:20 -07:00
Konstantin Shcheglov 3da4d937cd DeCo. With Feature.primary_constructors secondary constructors are implicitly const.
Bug: https://github.com/dart-lang/language/issues/4494
Change-Id: Ifdad0e7878c9586266e4b49643e083d22313258e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493967
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2026-04-09 08:52:39 -07:00
Sam Rawlins 4c9e441b4d DAS: lazily normalize paths in the session logger
Fixes https://github.com/dart-lang/sdk/issues/63009

Change-Id: Ifdf4b4dc7216edc5294c7faaff614ba0a4f4ecc9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493965
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2026-04-09 08:01:50 -07:00
Brian Wilkerson d804fca4e8 Convert more pieces of the rename refactor
This converts three more of the rename classes to use a ChangeBuilder.
There are still several more to come.

Change-Id: Ie03a356855a7ec1bbe602ab9ac824b10dc46834a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/494000
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2026-04-09 06:42:00 -07:00
Konstantin Shcheglov 9bec262263 FixCrash. Fix inferUndefinedExpressionType() to handle missing positional / named record type field.
Change-Id: Ie3758d195f8f4e352880616c50b1f28a7337eeb5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493964
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-04-08 17:28:26 -07:00
Brian Wilkerson c6a0f08eb0 Update convert-into-block-body for primary constructors
This updates convert-into-block-body to work on primary constructor
bodies.

It also makes it work for top-level container declarations.

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

Change-Id: I9b57b73a631aee8446f6c046d6faf23e7eea827f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/493488
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Keerti Parthasarathy <keertip@google.com>
2026-04-08 13:14:34 -07:00