roslyn
roslyn copied to clipboard
When moving class to another namespace, the this. qualification is removed from the code (IDE0009).
This issue has been moved from a ticket on Developer Community.
[severity:It bothers me. A fix would be nice] When moving a C# code file, i.e. a class, to a new folder using the Solution Explorer (i.e. drag&drop the file in another folder), and agree to the "Adjust namespaces for moved files?" questions, the namespace is correctly adjusted, but all "this." qualifications to local fields or properties are removed from the file.
For example
/// <inheritdoc/>
public override string ToString()
{
return $"{this. X} x {this. Y} -> {this. Distance:G3}";
}
becomes
/// <inheritdoc/>
public override string ToString()
{
return $"{X} x {Y} -> {Distance:G3}";
}
This is not what the function is supposed to do. It can of course be fixed by applying the code fix for IDE0009, but changing the namespace should not remove the tag.
Original Comments
Feedback Bot on 5/29/2023, 09:51 PM:
(private comment, text removed)
Original Solutions
(no solutions)