Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Name Can Be Simplified - Visual Studio

Is there a way to do all the lightbulb-action for a whole Solution and with a button or a shortcut?

Or to add a using for a term which could be simplyfied but is not shown through a lightbulb?

  • I have multiple Documents which include terms like "System." or "System.Threading."
  • I don't know exactly how many documents I have not checked them all
  • I don't want to use Search & Replace because I don't know how many things could possibly be simplified
  • I want the code to be readable and don't want a unnessecary difficult term to be left in there.
  • No I have not created the mess. I have to use the code which was created by an another person before
like image 491
Snickbrack Avatar asked Apr 12 '17 09:04

Snickbrack


1 Answers

If you click the drop down next to the lightbulb, it will give the option to change all the occurences of the simplification in the document, project or solution.

It looks something like this:

Image of solution simplification

Of course, for that to work you will need to add the necessary using statements to your files. I know that resharper has an option for you to add namespaces that should always be imported in your files. If you don't have access to it, can try the free trial they provide and see if it helps you.

like image 154
bkaf Avatar answered Nov 18 '22 22:11

bkaf