- Select a block of code in the editor, or place the caret at the line that you're going to comment out.
- On the main menu, choose ReSharper | Edit | Comment With Line Comment, or press Ctrl+/Ctrl+Alt+/.
- Select a block of code in the editor.
- On the main menu, choose ReSharper | Edit | Comment With Block Comment, or press Ctrl+Shift+/Ctrl+Shift+/.
The examples below show the results of each action:
If nothing is selected and you press Ctrl+/Ctrl+Alt+/, ReSharper comments the current line and moves the caret to the next line.
If nothing is selected and you press Ctrl+Shift+/Ctrl+Shift+/, the opening block comment and the closing block comment are inserted directly before and directly after the caret position.
This feature is supported in the following languages/technologies:
The instructions and examples given here address the use of the feature in C#. For details specific to other languages, see the corresponding topics in the ReSharper by Language section.