codemaid
codemaid copied to clipboard
Saving an Xaml file with unused namespace(s) causes all namespaces to get mixed up.
Environment
- Visual Studio version: Community 16.8.5
- CodeMaid version: 11.2
- Code language: C#
Description
When saving an XAML file with an unused namespace causes all the namespaces to become mixed up... the unused namespace is actually removed however
Steps to recreate
Save an XAML file with unused namespace
Current behavior
Namespaces get all mixed up and leads to incorrectly defined xaml file
Expected behavior
Should removed unused namespace and Xaml file should still be correctly defined.
Before save (note red arrow pointing to unused namespace)
After save:
Thanks for reporting the issue. I wasn't able to immediately reproduce it. Can you please provide a minimal solution that exhibits the bug?
I have this too. It happens in a lot of my xaml files but I cant reproduce it in a sample project, even when I copy and paste the repeatably broken files into the test project verbatim.
I am unable to share the affected code sorry.
@codecadwallader I should be able to get a sample project soon.
It seems to have something to do with simultaneously sorting and removing namespaces.
Deleting a namespace when all of them are sorted works correctly. Once a file is "broken" you have to restart Visual Studio to make it work again.
Just happened, but it is very rare, I can't reproduce it.
@LeoJHarris closing this as no longer appears to be an issue anymore. Using it with VS 2022 community for the last wee while without incident.