2

Is there a way to comment out a chunk of code quickly using CodeRush ?

 'For narCounter = 0 To UBound(arPDFFiles) ' 'Add the PDF File Names to the Data Table. ' rowPDF = dtPDF.NewRow ' rowPDF("PDFDocument") = arPDFFiles(narCounter) ' dtPDF.Rows.Add(rowPDF) 'Next 
1
  • Why not add your comment as an answer ? Commented Apr 7, 2011 at 12:39

4 Answers 4

4

Yes, the CodeRush Pro has the Selection Comment feature. This feature adds the capability to quickly comment or uncomment a multi-line block of code (or any text in the code editor) via a single shortcut. In Visual Basic, it is (‘)(Apostrophe) and in CSharp (or C++), it is (/) (Slash). Note that if you are using CodeRush Xpress, it doesn't have this feature. Here is some more info on this.

Sign up to request clarification or add additional context in comments.

2 Comments

Additionally it should be noted that if you are based using a uk keyboard the VB.Net binding is by default set to # rather than '
This is due to the way keybindings are stored. the US code for ' and the Uk code for # are apparently the same.
2

Yes, this can be done using CodeRush. Select a code and press the ' button.

1 Comment

See my comment on Alex's Answer
1

You can use Ctr+E, C which is already built into Visual Studio

5 Comments

The CodeRush shortcut (') is easier, and a lot more intuitive.
@cometbill: To a vb developer it might be more intuitive, but for a c# developer maybe not. To be honest I didn't know about that shortcut myself, and I use CodeRush quite a bit.
The C# shortcut to the same feature is / (slash). This is the same key as used in making single line comments in c# itself. This allows the Learning curve to be very low in this area.
I suspect @cometbill references the '(apostrophe) because he is a vb dev. His original question related to VB.net, but we've obviously considered c# devs in our implementation.
Hey Ole_Brun could you contact me via email ([email protected]) and I'll see if I can't find out what's wrong here. It's almost sounds like a VB user has been messing with your settings. :)
0

Ctrl K + C in VS does this too.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.