private void Execute() { var extendSpanResult = _commentFormatter.ExtendSpan(_textView.Selection.StreamSelectionSpan.SnapshotSpan); if (extendSpanResult == null) { return; } var result = _commentFormatter.FormatLines(extendSpanResult); if (result == null) { return; } using (var edit = _textView.TextBuffer.CreateEdit()) { if (_commentFormatter.ApplyChanges(edit, result)) { edit.Apply(); } } }