Skip to content

Code-generators should provide a way to "bundle" renaming #60072

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

Closed
rrousselGit opened this issue Feb 6, 2025 · 1 comment
Closed

Code-generators should provide a way to "bundle" renaming #60072

rrousselGit opened this issue Feb 6, 2025 · 1 comment
Labels
legacy-area-analyzer Use area-devexp instead. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-enhancement A request for a change that isn't a bug

Comments

@rrousselGit
Copy link

Reopening #56764 (comment) as I don't think it should've been closed.


Hello!
This is similar to #56518, but for another core IDE functionality: Renaming.

One way code-generators often work is by generating a new identifier, based on a user-defined identifier.
Like @example class UserDefined vs userDefinedGenerated, where the latter is generated based on a string transformation of the former.

The problem is, renaming renaming one of the two identifiers won't rename the other.

  • Renaming @example class UserDefined will correctly update the generate code, but any existing reference to userDefinedGenerated will stay unchanged. Users will then have to modify those by hand ; which can be very tedious and error prone.
  • Renaming userDefinedGenerated will not update UserDefined ; which means re-generating the code will revert our rename.

It would be great for the IDE to be able to rename both the generated and user-defined identifiers at once.

@dart-github-bot
Copy link
Collaborator

Summary: Code generators don't automatically update both user-defined and generated identifiers when one is renamed, requiring manual updates and causing inconsistencies. A solution to bundle renaming of both is requested.

@dart-github-bot dart-github-bot added legacy-area-analyzer Use area-devexp instead. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-enhancement A request for a change that isn't a bug labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-analyzer Use area-devexp instead. triage-automation See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants