Skip to content

Fix document rename when case is same#41181

Merged
ryzngard merged 1 commit intodotnet:masterfrom
ryzngard:issue/39617_rename_file_adds_1
Jan 24, 2020
Merged

Fix document rename when case is same#41181
ryzngard merged 1 commit intodotnet:masterfrom
ryzngard:issue/39617_rename_file_adds_1

Conversation

@ryzngard
Copy link
Copy Markdown
Contributor

When renaming a document, we ensure that the name is unique
but include the old document name in the check. Since that's
the document that's name is changing, we can ignore it
when comparing names for uniqueness.

Fixes #39617

When renaming a document, we ensure that the name is unique
but include the old document name in the check. Since that's
the document that's name is changing, we can ignore it
when comparing names for uniqueness.
@ryzngard ryzngard requested a review from a team as a code owner January 23, 2020 20:56

<WpfFact>
<Trait(Traits.Feature, Traits.Features.Rename)>
Public Sub VerifyFileRenamesCorrectlyWhenCaseChanges()
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note that this doesn't actually validate the fix needed in this change, but I believe is a worthwhile test so I kept it.

Copy link
Copy Markdown
Member

@jasonmalinowski jasonmalinowski left a comment

Choose a reason for hiding this comment

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

Nice fix!


VisualStudio.Editor.SendKeys(VirtualKey.Home, VirtualKey.Delete, VirtualKey.P, VirtualKey.Enter);

VisualStudio.SolutionExplorer.Verify.FileContents(project, "program.cs",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does the Verify.FileContents fail if the program.cs wasn't renamed at all and the file on disk is still called Program.cs?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmmm.... I was really hoping it would check the file name matches case but it doesn't... It does verify that it's not called "Program1.cs" though =/

@ryzngard ryzngard merged commit b8173e9 into dotnet:master Jan 24, 2020
@ryzngard ryzngard deleted the issue/39617_rename_file_adds_1 branch January 24, 2020 01:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Changing class name casing renames file in C #

2 participants