Skip to content

Update dependency to use analyzer 13#359

Merged
eernstg merged 6 commits into
masterfrom
update_versions_analyzer13_may26
May 26, 2026
Merged

Update dependency to use analyzer 13#359
eernstg merged 6 commits into
masterfrom
update_versions_analyzer13_may26

Conversation

@eernstg

@eernstg eernstg commented May 20, 2026

Copy link
Copy Markdown
Collaborator

This PR changes the dependencies in the reflectable packages to use analyzer ^13.0.0 and migrates the code generator accordingly. In particular:

Analyzer ^13.0.0 removes the class DefaultFormalParameter. Default values are now handled via a property on FormalParameter. Old approach: Check if a parameter node is a DefaultFormalParameter, access its defaultValue. New approach: Check the defaultClause property on a FormalParameter or RegularFormalParameter and access its value.

Similarly, the class NamedExpression has been removed and replaced by NamedArgument, in order to model named arguments in an ArgumentList. Old approach: Use expression is NamedExpression and access expression.name and expression.expression. New approach: Use expression is NamedArgument and access expression.name.lexeme to get the label name and expression.argumentExpression to get the value.

Finally, the arguments property of ArgumentList now returns a NodeList<Argument> instead of a NodeList<Expression>. Various loops have been updated to use the new types.

This PR also prepares reflectable for a release as v5.2.3 and reflectable_builder as v1.2.3. Version v5.2.3 of reflectable doesn't actually change anything other than the version, but I'd like to allow all usages of reflectable and reflectable_builder to remain in sync with respect to the version number such that developers can always update those two IDs together (e.g., from 5.2.2 to 5.2.3 along with 1.2.2 to 1.2.3, simultaneously).

Finally, this PR fixes a bug in 'example.dart' (where a lint asked for a type annotation on a parameter, but the type annotation which was added was wrong).

@eernstg eernstg requested a review from sigurdm May 20, 2026 07:59
@eernstg

eernstg commented May 20, 2026

Copy link
Copy Markdown
Collaborator Author

Hello @sigurdm, the update to analyzer 12.0.0 turned out to be non-breaking (as seen from this package, at least), so I took another step and updated it directly to analyzer 13.0.0.

Comment thread packages/reflectable_builder/lib/src/builder_implementation.dart
@eernstg eernstg merged commit a287ecc into master May 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants