Search code examples
devexpresscoderush

CodeRush - Commenting out whole sections of code


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

Solution

  • 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.