| FormatCommenterCommentLines Method |
Comment out a span using a particular line comment format. If the span is empty, the
entire line containing the span's start point is commented.
Namespace: Tvl.VisualStudio.Text.CommenterAssembly: Tvl.VisualStudio.Commenter.Utility.10 (in Tvl.VisualStudio.Commenter.Utility.10.dll) Version: 1.0.0.0
Syntax protected virtual VirtualSnapshotSpan CommentLines(
VirtualSnapshotSpan span,
ITextEdit edit,
LineCommentFormat format
)
Protected Overridable Function CommentLines (
span As VirtualSnapshotSpan,
edit As ITextEdit,
format As LineCommentFormat
) As VirtualSnapshotSpan
protected:
virtual VirtualSnapshotSpan CommentLines(
VirtualSnapshotSpan span,
ITextEdit^ edit,
LineCommentFormat^ format
)
abstract CommentLines :
span : VirtualSnapshotSpan *
edit : ITextEdit *
format : LineCommentFormat -> VirtualSnapshotSpan
override CommentLines :
span : VirtualSnapshotSpan *
edit : ITextEdit *
format : LineCommentFormat -> VirtualSnapshotSpan
Parameters
- span
- Type: Microsoft.VisualStudio.TextVirtualSnapshotSpan
The span of text to comment. - edit
- Type: Microsoft.VisualStudio.TextITextEdit
The ITextEdit to apply the changes to. - format
- Type: Tvl.VisualStudio.Text.CommenterLineCommentFormat
The line comment format to use for commenting the code.
Return Value
Type:
VirtualSnapshotSpanA
VirtualSnapshotSpan containing the commented code.
Exceptions Remarks The default algorithm for line comments is designed to meet the following conditions.
- Make sure line comments are indented as far as possible, skipping empty lines as necessary.
- Don't comment N+1 lines when only N lines were selected by clicking in the left
margin.
See Also