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

Refactoring namespace removes this operator #61465

Open
vsfeedback opened this issue May 23, 2022 · 3 comments
Open

Refactoring namespace removes this operator #61465

vsfeedback opened this issue May 23, 2022 · 3 comments
Labels
Area-IDE Concept-Continuous Improvement help wanted The issue is "up for grabs" - add a comment if you are interested in working on it IDE-CodeStyle Built-in analyzers, fixes, and refactorings
Projects
Milestone

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice]
When using Visual Studio to refactor namespaces, the class where the namespace has been refactored loses any "this" operators in the class.

Steps to reproduce:

  1. Create a C# class with some fields or properties.
  2. Reference said fields or properties with this operator.
  3. Right click namespace and refactor to a different namespace.
  4. See that all this operators are removed.

Original Comments

Feedback Bot on 5/19/2022, 08:13 PM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels May 23, 2022
@vatsalyaagrawal vatsalyaagrawal added Question IDE-CodeStyle Built-in analyzers, fixes, and refactorings and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jun 2, 2022
@vatsalyaagrawal vatsalyaagrawal added this to the 17.3 milestone Jun 2, 2022
@sharwell
Copy link
Member

sharwell commented Jun 3, 2022

In general, refactoring a namespace requires expansion and simplification of identifiers to ensure they bind correctly in the new context. This refactoring could be updated to ignore qualified names that start with this. or base., since these values are always going to retain their original meaning in the new context.

@sharwell sharwell added help wanted The issue is "up for grabs" - add a comment if you are interested in working on it Concept-Continuous Improvement and removed Question labels Jun 3, 2022
@sharwell sharwell added this to InQueue in Small Fixes via automation Jun 3, 2022
@sharwell sharwell moved this from InQueue to CodeFix/Refactoring Improvements in Small Fixes Jun 3, 2022
@sharwell sharwell modified the milestones: 17.3, Backlog Jun 3, 2022
@adtyn
Copy link

adtyn commented Jun 3, 2022

I would like to pick this up
if possible more instruction would be great

@sharwell
Copy link
Member

sharwell commented Jun 3, 2022

@Cosifne @ryzngard I'm not sure where this refactoring performs its post-rename corrections. Can you point @adtyn to it? 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Concept-Continuous Improvement help wanted The issue is "up for grabs" - add a comment if you are interested in working on it IDE-CodeStyle Built-in analyzers, fixes, and refactorings
Projects
Small Fixes
  
CodeFix/Refactoring Improvements
Development

No branches or pull requests

5 participants