Generally I've no complaints about the speed of Visual Studio, but if I write a macro that writes out about 100 lines of code, it takes 1-2 minutes to complete.
That doesn't sound right. Is there another more convenient way to write code blocks?
For one thing, I noticed it fills the undo buffer as if I'm just typing the text by hand. Could I mimic copy/paste behavior, which is much faster?
Here's a somewhat contrived example I tried to test my case:
Sub WriteManyLines()
DTE.Commands.Raise("{AA61C329-D559-468F-8F0F-4F03896F704D}", 2, Customin, Customout)
DTE.Commands.Raise("{AA61C329-D559-468F-8F0F-4F03896F704D}", 5, Customin, Customout)
Dim sb As New StringBuilder()
For i As Integer = 1 To 100
sb.AppendFormat("public string Method{0:000}() {{ return ""Method{0:000}""; }}", i)
sb.AppendLine()
Next i
DTE.ActiveDocument.Selection.Text = sb.ToString()
End Sub