-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Copy/paste not working within folder in Explorer #10767
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking mostly good already. However, I noticed that copying a folder leads to some weird behavior. Instead of creating <original-name> copy
, the copied folder is called copy<original-name>
instead.
84601d3
to
de848dd
Compare
I could reproduce the behavior you mention for hidden folders and files, whose names begin with a |
@AlexandraBuzila I see, I simply used the I wouldn't say it's in error in the path implementation, files like
|
de848dd
to
8f5bedd
Compare
I rebased and updated the code to handle files and folders that start with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking better, but copying a copied file results in <filename> copy copy.<ext>
. In VSCode copying <filename> copy.<ext>
leads to creating <filename> copy 2.<ext>
instead. I believe we should align to VSCode's behavior.
8f5bedd
to
e9c72f2
Compare
Should be fixed now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost working correctly now. I believe this point hasn't been resolved correctly:
Folders are always copied as
<basename> copy
Because naming a folder test.theia
and copying it, leads to the new file name test copy.theia
. In VSCode this will be test.theia copy
instead.
e9c72f2
to
780b3bd
Compare
You're right, I missed that. It should be fixed now. I also added some test cases. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good now!
- Copying files (with and without names) works as in VSCode
- Copying folders works as in VSCode
Please address my documentation related suggestions and I'll merge before the release!
780b3bd
to
05ad206
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh well, I didn't notice the test failure on Windows. Some test in navigator.spec.js
is failing on Windows. Do you mind addressing it?
If you don't have access to a Windows system to reproduce the issue, I will look into it next week.
I can have a look at it at the beginning of next week. |
05ad206
to
3c254e7
Compare
The targetUri computed in the copy method from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looking well now! The behavior is perfectly aligned to VSCode now:
- Copying a normal file suffixes
copy (<number>)
to its filename. - Copying a file without a filename, suffixes
copy (<number>)
to its fullname. - Copying a folder suffixes the fullname as well.
- Copying a folder into itself will result in a copied sibling folder.
@AlexandraBuzila There seem to be some conflicts (although GitHub isn't willing to show me what it is - I suspect the changelog). Do you mind resolving them? I'll merge this afterwards. |
* treat paste on parent directory same as paste on copied file * fix paste of folder on self * use spaces instead of underscores as separators inside file names for newly created files/folders * fix unique name generation for dotfiles/folders Signed-off-by: Johannes Faltermeier <[email protected]> Signed-off-by: Alexandra Buzila <[email protected]>
3c254e7
to
32e8eb4
Compare
I rebased the changes and fixed the conflict (it was indeed the changelog). |
What it does
Fixes copy/pasting of a file or folder within the same parent folder in the Explorer, by renaming the target file if the source and target URIs are the same.
Also changes the naming scheme to use spaces instead of underscores when creating a new file, to align with VS Code and user expectations (e.g. on macOS).
Fixes #9923
How to test
Testing copy/paste in the same parent folder:
originalName copy.ext
ororiginalName copy index.ext
)Testing the name generation of new files:
Several commands were affected by the change in naming for new files/folders. New files/folders should now have spaces instead of underscores in the generated name portion:
Untitled 2.txt
copy <index>
appended to the original file namecopy <index>
appended to the original file nameReview checklist
Reminder for reviewers