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

Renaming a file to a .cs file causes extra items in the project file #5049

Open
davidwengier opened this issue Jul 14, 2019 · 6 comments
Open
Labels
Area-External-CPS Owned by CPS and not this repo. Likely be closed in lieu of issue filed against VS platform. Feature-Project-File-Simplification Related to cleaning up and simplification of the project format. Triage-Approved Reviewed and prioritized
Milestone

Comments

@davidwengier
Copy link
Contributor

davidwengier commented Jul 14, 2019

From @NickCraver on twitter: https://twitter.com/Nick_Craver/status/1150201135095066624

Repro:

  1. Right click, add a class
  2. File.Test as the name, enter
  3. Because of the . in there, .cs wasn't appending, so F2 on file and change to File.Test.cs
  4. This is in the .csproj:
    image

This is probably just None globbing (#4534) but maybe there is a small fix to be made in CPS to specifically improve the rename scenario.

@davidwengier davidwengier added Area-External-CPS Owned by CPS and not this repo. Likely be closed in lieu of issue filed against VS platform. Feature-Project-File-Simplification Related to cleaning up and simplification of the project format. Triage-Approved Reviewed and prioritized labels Jul 14, 2019
@davidwengier
Copy link
Contributor Author

davidwengier commented Jul 14, 2019

On second thought, this isn't None globbing at all. The issue here is that the user is renaming something that has an ItemType of None and CPS is trying to keep that same ItemType, even though the new name means the item is picked up by the Compile glob. This is a good thing in general, but specifically when its done straight after a New Item template its annoying.

@NickCraver
Copy link
Member

Perhaps maybe the improvement to be made here is in the detection of when to add .cs on the end of a file when adding a class? If I'm selecting class in the menu, I'm trying to add a class, and every period in a filename I've ever come across doesn't end in a valid language extension.

It seems like perhaps improving the logic from "does it have a dot?" to "does it have a known file extension?" could work. But maybe that breaks some crazy workflows, I dunno - just tossing out the idea!

@davidwengier
Copy link
Contributor Author

Yeah, agreed, the new item dialog would be a great place to fix this too if possible.

@davidwengier davidwengier removed the Triage-Approved Reviewed and prioritized label Feb 3, 2020
@jjmew jjmew added the Triage-Investigate Reviewed and investigation needed by dev team label Feb 3, 2020
@jjmew
Copy link
Contributor

jjmew commented Feb 3, 2020

The fix could live in 2 different components. CPS or New file dialog. There needs to be an investigation on where is the right place for the fix.

@swesonga swesonga removed the Triage-Investigate Reviewed and investigation needed by dev team label Nov 2, 2021
@swesonga swesonga removed their assignment Nov 2, 2021
@jjmew jjmew added the Triage-Approved Reviewed and prioritized label Nov 16, 2021
@jjmew jjmew added this to the 17.2 milestone Nov 16, 2021
@drewnoakes
Copy link
Member

Sending back to triage as Osvaldo is on parental leave for the remainder of 17.2.

@drewnoakes drewnoakes removed the Triage-Approved Reviewed and prioritized label Mar 14, 2022
@tmeschter tmeschter modified the milestones: 17.2, 17.3 Mar 17, 2022
@tmeschter tmeschter added the Triage-Approved Reviewed and prioritized label Mar 17, 2022
@kvenkatrajan kvenkatrajan added this to Under Consideration in Partner Team Requests Apr 12, 2022
@adamint adamint modified the milestones: 17.3, 17.4 Aug 19, 2022
@adamint
Copy link
Member

adamint commented Aug 19, 2022

@ocallesp?

@kvenkatrajan kvenkatrajan modified the milestones: 17.4, 17.5 Sep 27, 2022
@kvenkatrajan kvenkatrajan modified the milestones: 17.5, 17.x Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-External-CPS Owned by CPS and not this repo. Likely be closed in lieu of issue filed against VS platform. Feature-Project-File-Simplification Related to cleaning up and simplification of the project format. Triage-Approved Reviewed and prioritized
Projects
Partner Team Requests
Under Consideration
Development

No branches or pull requests

9 participants