-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
move to file doesn't move associated private function #60379
Comments
That is definitely a bug. The tool should not be producing invalid code. The only question is how to fix the bug. I can think of several options.
The first option is the most restrictive, but is also probably the easiest to implement, so we might want to start with that just to fix the bug as quickly as possible. Though if it proves to not be too difficult to implement the second option that would be even better. I would be in favor of the third option if we could give the user the ability to choose whether to continue with the refactoring after being told about the references. If the user isn't aware of the references, or doesn't want the private declarations moved for some other reason, then it could be surprising to have them moved without any notification. Of course, it could also be confusing if we can't explain why the refactoring isn't available in some cases, so we have to balance those two factors. I would not want the fourth option without the ability for the user to choose between duplicating (some of) the private members and expanding the move to include the declarations that would have been left that also reference those private declarations. In other words, if a private declaration is referenced by both code to be moved and code to be left, duplicating the code is not at all an obvious choice of action, as illustrated by the fifth option, which is also not an obvious choice. |
I'd opened #56791 to have this discussion previously. If you prefer we can defere here or there either way. I'm on my phone now so I will only be able to move the comments easily later. Edit: Just as a quick vote, I'd prefer 2, 3 and 5 combined if possible. |
Just reviewed that issue and there seems to be no new suggestion or info that wasn't already discussed here. Closed that one since this already has more conversation. |
move to file option in vscode to
revealIn
doesn't move the private helper functions associated, so it doesn't workThe text was updated successfully, but these errors were encountered: