public void VsTextViewCreated(IVsTextView textViewAdapter)
        {
            IWpfTextView textView = AdaptersService.GetWpfTextView(textViewAdapter);

            if (textView == null)
            {
                Debug.Fail("Unexpected: couldn't get the text view");
                return;
            }

            IEditorOperations operations = OperationsService.GetEditorOperations(textView);

            if (operations == null)
            {
                Debug.Fail("Unexpected: couldn't get the editor operations object");
                return;
            }

            ITextUndoHistory undoHistory;

            if (!UndoHistoryRegistry.TryGetHistory(textView.TextBuffer, out undoHistory))
            {
                Debug.Fail("Unexpected: couldn't get an undo history for the text buffer");
                return;
            }

            Func <VisualRustAutoindent> autodedent = () => new VisualRustAutoindent(textViewAdapter, textView, operations, undoHistory);

            textView.Properties.GetOrCreateSingletonProperty(autodedent);
        }
Beispiel #2
0
 public IEditorOperations3 GetOperations(ITextView textView)
 {
     return((IEditorOperations3)OperationsService.GetEditorOperations(textView));
 }