Great. I have a "solution" to solving the problem.
I use a separate AddComment, RemoveComment macro script to do this. AddComment will add a level of indentation comment to selected text while RemoveComment will remove a level of indentation. I use only //, no /**/ as the latter doesn't work well when I have to comment large chunks of already commented out code.
The reason I would like VA to have this too is because the VS macros are slow.
''' CommentRegion puts line-oriented comment syntax at the beginning
''' of every line the selection touches and creates an undo so that
''' there is only one undo action for all the lines edited.
Sub CommentRegion()
Dim selection As TextSelection = DTE.ActiveDocument.Selection()
Dim start As EditPoint = selection.TopPoint.CreateEditPoint()
Dim endpt As TextPoint = selection.BottomPoint
Dim commentStart As String = LineOrientedCommentStart()
start.StartOfLine()
Dim bUndo As Boolean = Not DTE.UndoContext.IsOpen()
If bUndo Then
DTE.UndoContext.Open("Comment Region")
End If
Try
Do While (start.LessThan(endpt))
start.Insert(commentStart)
start.LineDown()
start.StartOfLine()
Loop
selection.SmartFormat()
Finally
'If an error occured, then need to make sure that the undo context is cleaned up.
'Otherwise, the editor can be left in a perpetual undo context
If bUndo Then
DTE.UndoContext.Close()
End If
End Try
End Sub
' Uncomment code
Sub UncommentRegion()
Dim selection As TextSelection = DTE.ActiveDocument.Selection()
Dim bUndo As Boolean = Not DTE.UndoContext.IsOpen()
If bUndo Then
DTE.UndoContext.Open("UnComment Region")
End If
Try
DTE.ExecuteCommand("Edit.UncommentSelection")
selection.SmartFormat()
Finally
'If an error occured, then need to make sure that the undo context is cleaned up.
'Otherwise, the editor can be left in a perpetual undo context
If bUndo Then
DTE.UndoContext.Close()
End If
End Try
End Sub