protected override IWpfTextViewHost /*!*/ CreateTextViewHost()
            {
                var adapterFactory = ComponentModel.GetService <IVsEditorAdaptersFactoryService>();
                var provider       = (Microsoft.VisualStudio.OLE.Interop.IServiceProvider)_window.GetService(typeof(Microsoft.VisualStudio.OLE.Interop.IServiceProvider));

                // create the buffer adapter and initialize it
                IVsTextBuffer bufferAdapter = adapterFactory.CreateVsTextBufferAdapter(provider, ContentType);
                int           result        = bufferAdapter.InitializeContent("", 0);

                bufferAdapter.SetLanguageServiceID(_window.LanguageServiceGuid);

                // ITextEditor is available only after InitializeContent was called:
                ITextBuffer textBuffer = adapterFactory.GetDataBuffer(bufferAdapter);

                // we need to set IReplProptProvider property before TextViewHost is instantiated so that ReplPromptTaggerProvider can bind to it
                if (Evaluator.DisplayPromptInMargin)
                {
                    textBuffer.Properties.AddProperty(typeof(IReplPromptProvider), this);
                }

                // Create and inititalize text view adapter.
                // WARNING: This might trigger various services like IntelliSense, margins, taggers, etc.
                IVsTextView textViewAdapter = adapterFactory.CreateVsTextViewAdapter(provider, GetReplRoles());

                ((IVsWindowPane)textViewAdapter).SetSite(provider);

                // make us a code window so we'll have the same colors as a normal code window.
                IVsTextEditorPropertyContainer propContainer;

                ((IVsTextEditorPropertyCategoryContainer)textViewAdapter).GetPropertyCategory(Microsoft.VisualStudio.Editor.DefGuidList.guidEditPropCategoryViewMasterSettings, out propContainer);
                propContainer.SetProperty(VSEDITPROPID.VSEDITPROPID_ViewComposite_AllCodeWindowDefaults, true);

                textViewAdapter.Initialize(
                    (IVsTextLines)bufferAdapter,
                    IntPtr.Zero,
                    (uint)TextViewInitFlags.VIF_HSCROLL | (uint)TextViewInitFlags.VIF_VSCROLL,
                    new[] { new INITVIEW {
                                fSelectionMargin = 0, fWidgetMargin = 0, fVirtualSpace = 0, fDragDropMove = 1
                            } }
                    );

                // disable change tracking because everything will be changed
                var res = adapterFactory.GetWpfTextViewHost(textViewAdapter);

                res.TextView.Options.SetOptionValue(DefaultTextViewHostOptions.ChangeTrackingId, false);
                return(res);
            }