-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.
Description
Problem
Currently, when marking something as @Deprecated, we have to manually specify the recommended replacement in the message string:
@Deprecated("Don't use this anymore, use CoreScannerState<T>")This requires manual parsing of the message by the developer and does not provide a structured way for tooling to suggest replacements.
Proposed Solution
Introduce a replacement parameter in the @Deprecated annotation that explicitly defines the alternative type or member:
@Deprecated("Don't use this anymore", replacement: CoreScannerState<T>)Benefits:
- The IDE can automatically extract and display the replacement.
- Tooling can provide direct refactoring suggestions.
- The message remains clear while keeping metadata structured.
Current Behavior
When hovering over a deprecated member, the IDE tooltip says:
"... Try replacing the use of the deprecated member with the replacement."
However, "the replacement" is not configurable, and the developer must manually read and interpret the message.
Expected Behavior
By allowing a replacement argument, the IDE and tools can explicitly guide developers on what to use instead.
FMorschel
Metadata
Metadata
Assignees
Labels
area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.For issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.