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

Offer a better class file duplication / rename method #49057

Open
S0und opened this issue Oct 28, 2020 · 1 comment
Open

Offer a better class file duplication / rename method #49057

S0und opened this issue Oct 28, 2020 · 1 comment

Comments

@S0und
Copy link

S0und commented Oct 28, 2020

Visual Studio Version: 16.7.7

Summary: There are times when you already have a class or report and you need a pretty similar file. So duplicating the already existing one and changing it is much faster, then recreating a new one from scratch. The problem is that VS doesn't offer a nice way to duplicate a file with a new given name. If you copy a file and paste it into the same folder, VS detect the file duplication and the pasted file will automatically gets a " - Copy" file name suffix. The problem is VS in this state unable to refactor the filename and it's class and constructor name. Which by convention all should be the same.

I would guess this is an expected behavior, since this is how Windows handles file duplication. So if you copy a file and paste it into the same folder - without any warning - the new file will get a " - Copy" suffix. You only get the file duplication prompt window if you copy files between folders, but not in the same folder.

Steps to Reproduce:

https://giant.gfycat.com/LinearHopefulAlabamamapturtle.webm

Expected Behavior:

Here's how Intellij handles the same situation:
https://giant.gfycat.com/IgnorantDiscreteAustraliankestrel.webm

  1. it doesn't allow file duplication AND doesn't creates a new file automatically. So it doesn't creates a new file and leaves it in a "broken state" for further file name refactoring.

  2. When you give it a new and valid file name, the file's class and it's constructor are properly named after the file.

User Impact:

My issue is that there is no way to duplicate a file in a clean manner in VS. You can rename the file's name (+designer name if it has one), but the actual file content (class, constructor) needs to be manually edited.

@jjmew jjmew transferred this issue from dotnet/project-system Oct 29, 2020
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 29, 2020
@jinujoseph jinujoseph added Feature Request and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Nov 4, 2020
@jinujoseph jinujoseph added this to Backlog in IDE: InternalPriority via automation Nov 4, 2020
@jinujoseph jinujoseph moved this from Backlog to Priority 3 in IDE: InternalPriority Nov 4, 2020
@jinujoseph jinujoseph added this to the Backlog milestone Nov 4, 2020
@jinujoseph
Copy link
Contributor

cc @ryzngard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants