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
Dragging multiple files/folders are once does not update import statements #4533
Comments
Correction: sometimes imports are updated, sometimes they are not. I haven't figured out under which circumstances the imports are not updated. |
@lukehutch is it when you're dragging multiple items at once? Currently we only support moving a single "item" at a time. |
Yes, it was while moving multiple items. I couldn't reproduce it later because I was moving a single item at a time. |
Thanks for confirming. This is a known limitation of the rename. I thought there was an issue already open tracking this but I can't find one (here or in the SDK) so I'll keep this open for that. Unfortunately it's not a trivial fix. |
We already supported moving a single folder, which we expanded to each file inside it. This adds support for moving multiple distinct items at the same time (eg. dragging multiple files). To support this, we need to track a full mapping of source/destination paths (because files might be moved from different levels into the same level - we can't compute destination paths from a single `newFile` variable), and also build a unique set of references that need updating (rather than building edits as we go - where we might try to edit the same reference from both ends). Fixes Dart-Code/Dart-Code#4533 This is currently only supported for LSP. Change-Id: I3a8ab8b2dcb13451111d38d2ec0e2f69d6084e28 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329320 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Phil Quitslund <pquitslund@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This is fixed by dart-lang/sdk@09f3eb0 and will ship in a future SDK release. |
Describe the bug
If I drag a dart file from one folder to another in VSCode with Dart-Code, the imports of other dart files that depend upon that file are not updated (i.e. the imports end up broken).
Expected behavior
Import paths should be updated when files are moved.
Please complete the following information:
The text was updated successfully, but these errors were encountered: