-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
API: Provide an onMoved event for when the user moves a file/folder in the explorer #24846
Comments
needs underlying infrastructure from our fs-event service |
I am not aware of a cross platform file watcher that detects moves (instead of reporting ADD followed by a DELETE event). |
I'm not interested in getting the information from the file watcher. I'd just like to know when the user drags and drops a file or folder in the vs code explorer or when a user renames a file or folder in the vs code explorer. I want to respond to the user's action rather than to the file system changing. |
+1 for this. I implemented similar move extension by checking content hashes of files. Something like Also noticed what |
Not sure yet, other extension author might be confused by this. Ideally, we know this for good using the OS primitives (file events). Think of some one moving a file with the terminal (inside the tool) or think of cut and pasting a file. |
A solution could be to create a You could also add |
If you are just interested in us having done this, basically via explorer gestures, you want this: #1431 That issue is about letting people folks when a certain command ran or will run. That would be the better representation for that is because it doesn't have much to do with file watching anymore |
+1 I also really want an It looks like those vscode editor actions drill down into: https://github.com/Microsoft/vscode/blob/f686a20863de110239dcdc47a164fa576b2938ea/src/vs/workbench/services/files/electron-browser/remoteFileService.ts#L410 @bpasero is there any clean way these events can be propagated up into some sort of clean API for extensions and such? |
@stringham isn't this the same ask as #43768 I think we solved this already because in TS when I move a file I am being asked to update imports. |
/duplicate of #43768 |
Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines. Happy Coding! |
I created an extension which updates relative imports when you move a typescript file or a folder. Unfortunately, it's kind of clunky because it only works when the user uses the explorer context menu or the command pallet to move the items.
It would be great if I could hook into an event which occurs when the user moves a file or folder in the explorer. The FileSystemWatcher API currently has hooks for creation, deletion, and modification.
It would be possible to detect a file move with the onCreate and onDelete methods, but those events happen even when the creation/deletion originate from outside of vscode.
The text was updated successfully, but these errors were encountered: