UncommentBlock() public static method

Uncomments selected lines or current line if range has zero length. Only removes single comment. ### -> ## -> # and so on. Matches C# behavior.
public static UncommentBlock ( ITextView textView, ITextBuffer textBuffer, ITextRange range, IEditorShell editorShell ) : void
textView ITextView
textBuffer ITextBuffer
range ITextRange
editorShell IEditorShell
return void
Example #1
0
        public override CommandResult Invoke(Guid group, int id, object inputArg, ref object outputArg)
        {
            var selectionSpan = TextView.Selection.StreamSelectionSpan.SnapshotSpan;

            RCommenter.UncommentBlock(TextView.ToEditorView(), TextView.TextBuffer.ToEditorBuffer(),
                                      new TextRange(selectionSpan.Start.Position, selectionSpan.Length), Services.GetService <IEditorSupport>());

            return(CommandResult.Executed);
        }
Example #2
0
        public override CommandResult Invoke(Guid group, int id, object inputArg, ref object outputArg)
        {
            SnapshotSpan selectionSpan = TextView.Selection.StreamSelectionSpan.SnapshotSpan;

            RCommenter.UncommentBlock(TextView, TextView.TextBuffer,
                                      new TextRange(selectionSpan.Start.Position, selectionSpan.Length));

            return(CommandResult.Executed);
        }