XamlStyler
XamlStyler copied to clipboard
Option to remove unused namespaces
Not sure if this is outside the scope of the project, but having the option to remove unused namespaces could be a nice addition.
The solution shoud accept, that some custom markup extension can use the namespace. That means, that namespace can be used not only in node name, but also in some node attributes values
After further review, we would like to move forward with adding this feature. We do think it should be an option that is disabled by default to avoid inadvertently deleting code without the developer realizing it. If we can tap into the Visual Studio command, that would be preferred, but we should also be able to implement it ourselves in the core extension code.
a) I don't think this is a must-do b) @grochocki after 6 or 4 years, do you still want to add this?
I agree that it is not a must have, but also that it would be nice to provide the option to save a click by invoking the built-in VS feature if possible.
The original post shows this option as a separate context menu item. Is this expectation/intent/desire that this be:
- functionality (controlled via a new setting--and off by default) that is executed as part of the standard formatting behaviour
- something that can be triggered via a new content menu entry for an individual file
- both
The first option is the easiest/quickest and doesn't introduce the complexities of adding support for different IDEs.
I'm assuming that changing the visuals of namespaces that are defined but not used is out of scope.
The first option is the easiest/quickest and doesn't introduce the complexities of adding support for different IDEs.
Agreed. I don't think we'd add it as a new context menu entry as VS already puts it there. Unless I am missing something, the benefit to adding an option to XAML Styler would be to allow for a one-click cleanup vs. having to run both commands.