Hello,
I have a class "ProductMap" …
- The class is in "Mapping"
- I rename the namespace to not match the folder structre.
- I do a copy of the class to \infrastructure
- I apply the command the namespace is renamed to match folder structure BUT the class in \Mapping too.
- In RentProductsContext , where there is the using to \Mapping\ProductMap, the using in the context file is renamed too.
I join a video.
Christian,
Hello Christian,
Thank you for providing the screencast.
I have reproduced this issue on my side.
The cause of the issue that at the moment when you have two classes with the same full names, we cannot correctly detect which references are related to each of the class.
So, we are going to fix this by making the "Rename namespace to mach folder structure" refactoring unavailable for such cases.
As a workaround, we suggest you first rename the new class and after that apply the "Rename namespace to mach folder structure" refactoring.
We will notify you as soon as we fix this.
unavailable ? The command should be available but in this case only change the namespace in the current file only and not everywhere.
Hello Cristian,
Thank you for sharing your opinion with us.
We have discussed this with our team and concluded that we should make this refactoring unavailable with non-compilable code.
You can get the required behavior if you change the name of a new type to make code compilable. After that, you can use the "Rename namespace to match folder structure" refactoring.
We appreciate your cooperation.