Skip to content
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

Paste file/folder to other folder that already contain file/folder with the same name #8778

Merged
merged 1 commit into from
Dec 2, 2020
Merged

Conversation

i501378
Copy link
Contributor

@i501378 i501378 commented Nov 25, 2020

Signed-off-by: Lital Avigad lital.avigad@sap.com

What it does

When we want paste file/folder with to other folder that already contain file/folder with the same name, it change the copied file/folder name when we paste it and add to the end of the name _copy_${index}.
This code similar to vscode behavior on this scenario.

How to test

Create folder a withfile.txt.
Create folder b with file.txt.
Copy the file.txt from folder b and paste it in folder a.
The new file will be added to folder a with name file_copy.txt.
Copy again the file.txt from folder b and paste it in folder a.
The new file will be added to folder a with name file_copy_2.txt.

Review checklist

Reminder for reviewers

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the change fix #4794?
If so, we can link it so it will be closed on merge.

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the change fix #4794?
If so, we can link it so it will be closed on merge.

packages/filesystem/src/browser/file-service.ts Outdated Show resolved Hide resolved
@vince-fugnitto vince-fugnitto added CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) filesystem issues related to the filesystem labels Nov 25, 2020
@i501378
Copy link
Contributor Author

i501378 commented Nov 26, 2020

Hi @vince-fugnitto,
This is not fixing #4794, it handle the scenario when copy file between folders and not at the same folder.
Regards,
Lital.

@i501378
Copy link
Contributor Author

i501378 commented Nov 26, 2020

Hi,
I saw that there is already function at theia - generateUniqueResourceURI that do similar logic when we press on duplicate file/folder.
I update the code to use it and updated the description above.

Copy link
Member

@amiramw amiramw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM and tested successfully.

@amiramw amiramw removed the CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) label Dec 1, 2020
Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@i501378 can you please rebase the pull-request against master so CI (github actions) can run?

…th the same name

Signed-off-by: Lital Avigad <lital.avigad@sap.com>
@i501378
Copy link
Contributor Author

i501378 commented Dec 2, 2020

@vince-fugnitto Done

Copy link
Member

@vince-fugnitto vince-fugnitto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes work very well, thank you @i501378 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
filesystem issues related to the filesystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants