Prevent Visual Studio from deleting specific directives

I often use the "Delete and Sort" function of VS / PowerCommands - in fact, with R #, I do VS for this every time I save a document, which I almost almost reflexively do. I finish writing a line of code without errors.

However, there are several namespaces that, if any, I do not want to delete.

This mainly applies to System , System.Linq and System.Web.Collections.Generic , but there are others, and the specification is exactly which namespaces are likely to change in the future.

Is there a way to tell this function that "If you see a particular namespace and it is not currently in use, it doesnโ€™t matter, I will delete it manually."

+4
source share
1 answer

There is no way. You can write your own extension for visual studio, but I do not know the reason for this. If this is because you donโ€™t like writing lines, you can use the alt + shift + f10 shortcut, which it writes for you.

0
source

Source: https://habr.com/ru/post/1315643/


All Articles