my vs2008 addin for textformatting is awfully slow
i wrote a little addin, which does some formatting of my C# code. in the addins Exec method i do the following try { TextSelection selection = (EnvDTE.TextSelection)_applicationObject.ActiveDocument.Selection; String foo = String.Empty; if (!text.IsEmpty) { foo = someCoolObjectThatFormatsText.Format(selection.Text); selection.Text = foo; // here everything gets painfully slow :-( } } catch (Exception) { throw; } when the line with the code "SelectedText.Text = foobar;" is call, VS rebuilds each line of the selection step by step. You can easily watch it doing this step. But i don't get, why it