Comment Opening and closing brackets (using ReSharper?)

Does anyone know if there is a way in Visual Studio 2010 with ReSharper 6.1 to comment on highlighted lines of code with their closing brackets - or just comment on both the highlighted opening bracket and the corresponding closing bracket? Here is an example of what I mean:

if(something) { do(this); } 

I'm looking for a hotkey, so when if(something) { selected, it will comment on if(something) { and } , preferably fixing tabs once commented like this:

 // if(something) { do(this); //} 
+4
source share
1 answer

This is not exactly what you need, but it is pretty close:

Select the code inside the if by placing the cursor in one bracket and pressing Ctrl + Shift + ] .

Now press Ctrl + Shift + Alt + Left Arrow . This will cause the code to move β€œto the left,” that is, outside the if statement.

You do not need to comment on the if after that, because it is empty.

Note that you can also move the right code to put it back in the if later.

0
source

All Articles