mono/monodevelop — pull request #627 by DavidKarlas (2014-08-08 10:44:49+00:00)
Title: [Ide] Bug21849-Xaml CodeCompletionWindow closes after char added(SharedProject)

CodeCompletionWindows closed after first char was typed because there were two undisposed instances of FormsEditorExtension. First instance displayed window and marked that it shouldn't autoHide but second instance didn't mark this(because it didn't show window) it hid window. Hence bug.

This happened because when .xaml file opens it calls InitializeExtensionChain. Problem occurred when ((FormsEditorExtension)ext).Initialize (this); was which calls SetProject(to set owner project of document instead of SharedProject) and SetProject calls InitializeExtensionChain again.
So in middle of InitializeExtensionChain loop of adding editorExtensions new InitializeExtensionChain came in and disposed 1st editorExtensions chain. But when 2nd loop finished rest of 1st loop continued(extensions after FormsEditorExtension).

So what this commit does it checks if documents editorExtension is different from this InitializeExtensionChain call. And if different it disposes all editorExtensions in this call.