Have I mentioned that I'm a MACHINE!? ;)
Below is a cool little macro I wrote for VS.NET last night. It makes my code beautiful with one keystroke (ok, two..).
Perhaps I could have done it more reliably with a regular expression..?
John.
--
Public Sub Spacify()DTE.ExecuteCommand("Edit.Replace")
DTE.Find.FindWhat = "("
DTE.Find.ReplaceWith = "( "
DTE.Find.Target = vsFindTarget.vsFindTargetCurrentDocument
DTE.Find.MatchCase =
TrueDTE.Find.MatchWholeWord =
FalseDTE.Find.MatchInHiddenText =
TrueDTE.Find.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral
DTE.Find.ResultsLocation = vsFindResultsLocation.vsFindResultsNone
DTE.Find.Action = vsFindAction.vsFindActionReplaceAll
DTE.Find.Execute()
DTE.Find.FindWhat = ")"
DTE.Find.ReplaceWith = " )"
DTE.Find.Execute()
DTE.Find.FindWhat = "( "
DTE.Find.ReplaceWith = "( "
DTE.Find.Execute()
DTE.Find.Execute()
DTE.Find.Execute()
DTE.Find.Execute()
DTE.Find.Execute()
DTE.Find.Execute()
DTE.Find.FindWhat = " )"
DTE.Find.ReplaceWith = " )"
DTE.Find.Execute()
DTE.Find.Execute()
DTE.Find.Execute()
DTE.Find.Execute()
DTE.Find.Execute()
DTE.Find.Execute()
DTE.Find.FindWhat = "( )"
DTE.Find.ReplaceWith = "()"
DTE.Find.Execute()
DTE.Windows.Item(Constants.vsWindowKindFindReplace).Close()
End Subresult = DTE.Find.Execute()
Do While result = vsFindResult.vsFindResultReplaced
result = DTE.Find.Execute()
Loop
Much better. Thanks.