-
Notifications
You must be signed in to change notification settings - Fork 1.7k
"Move class to file" ask to export new file from source #56692
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
Comments
Summary: The "Move class to file" refactoring currently adds an unnecessary |
A little update, both of the following issues could also benefit from some form of "checking" before/after the assist. Imagine someone wants to add an import with both Also, as noted on (#56265) there could be some form of "hiding" some options in the list project-wise or user-wise. That could also help with this specific problem of filling up the options list. |
One more case: #56885 We could also ask (when making a new part file with this same feature - whenever it supports it) if we'd like to use the source file imports or add new imports on the specific file. |
That's a reasonable request. I'm not sure what the UI would look like for that, but the easiest solution might be to introduce a "Move Top Level to File and export" refactoring. Alternatively, we could ask users to do something like
(That assumes that move-top-level checks to see whether the target file is already exported and leaves the imports in other files unchanged in the case, which I'm fairly certain it currently doesn't do but should.) |
Something else that came to my attention recently was that if you have something like:
Once you move the content from the |
If you have the following project:
In
main.dart
:In
other.dart
:And you use "Move class to file" on
C
, the current output forother.dart
is (#56658 for theunused_import
):I'm not sure how this could be done, but I'd like to ask for a way for me to say if I want to add
export 'c.dart';
insidemain.dart
so that other files don't need to change.// CC: @DanTup
The text was updated successfully, but these errors were encountered: