-
Notifications
You must be signed in to change notification settings - Fork 17
Deprecated handling #118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Deprecated handling #118
Conversation
fe078bf to
970dc47
Compare
970dc47 to
092e156
Compare
|
Hi, thanks for the suggestion. Could you clarify the use case for this feature? If the purpose is to mark properties as deprecated, this is not the best approach, as in Dart, deprecation must be applied directly in the class where the property is defined. Applying 'Deprecated' in the mixin is not sufficient, as it does not propagate correctly to where it matters for consumers. Let me know the full context of what you’re trying to solve so we can evaluate it properly. |
|
Hi @Rongix
|
|
Hi @Rongix |
|
@Rongix |
Rongix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. I have 2 requests before we can merge it.
- Make sure you don't format old code, that will be formatted later on before releasing to pub via separate commit.
- Changes to how to handle deprecation:
- Try to extract deprecation message and store it in the field (similar way it is done with documentation)
- When generating copyWith method, construct
@Deprecateda new from deprecation message - Add an extension that handles deprecation message instead of this
.where((m) => m.toSource().startsWith('@Deprecated'))
.map((m) => m.toSource())
.toList(growable: false),
| name: e.displayName, | ||
| type: e.type.getDisplayString(withNullability: true), | ||
| documentation: e.documentationComment, | ||
| annotations: e.metadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could add a field deprecation instead, in a same manner as documentation is added. It is a language feature and I don't think we need to add handling for other annotations. Also it would be better if we were able to check @deprecated type instead checking if it string starts with @Deprecated
- see how
isThemeExtensionTypeis implemented, we would benefit from method that is also extension on type but gets deprecation message

Fixes test run by locking the build version
adds annotations handling for deprecations pass through