예제 #1
0
        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ISmartIndentationService smartIndentationService,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            IVimApplicationSettings vimApplicationSettings,
            SVsServiceProvider serviceProvider)
            : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
        {
            _vsAdapter = adapter;
            _editorAdaptersFactoryService = editorAdaptersFactoryService;
            _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _vsExtensibility = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
            _textManager = textManager;
            _sharedService = sharedServiceFactory.Create();
            _vsMonitorSelection = serviceProvider.GetService<SVsShellMonitorSelection, IVsMonitorSelection>();
            _fontProperties = new TextEditorFontProperties(serviceProvider);
            _vimApplicationSettings = vimApplicationSettings;
            _smartIndentationService = smartIndentationService;

            uint cookie;
            _vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
        }
 public BraceCompletionContext(ISmartIndentationService smartIndentationService, ITextBufferUndoManagerProvider undoManager, HlslClassificationService classificationService, IOptionsService optionsService)
 {
     _smartIndentationService = smartIndentationService;
     _undoManager = undoManager;
     _classificationService = classificationService;
     _optionsService = optionsService;
 }
예제 #3
0
 public BraceCompletionSessionProvider(
     ITextBufferUndoManagerProvider undoManager,
     IEditorOperationsFactoryService editorOperationsFactoryService)
 {
     _undoManager = undoManager;
     _editorOperationsFactoryService = editorOperationsFactoryService;
 }
예제 #4
0
 public InteractiveWindowProvider(
     IContentTypeRegistryService contentTypeRegistry,
     ITextBufferFactoryService bufferFactory,
     IProjectionBufferFactoryService projectionBufferFactory,
     IEditorOperationsFactoryService editorOperationsFactory,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextEditorFactoryService editorFactory,
     IRtfBuilderService rtfBuilderService,
     IIntellisenseSessionStackMapService intellisenseSessionStackMap,
     ISmartIndentationService smartIndenterService,
     IInteractiveWindowEditorFactoryService windowFactoryService,
     IWaitIndicator waitIndicator)
 {
     _contentTypeRegistry           = contentTypeRegistry;
     _bufferFactory                 = bufferFactory;
     _projectionBufferFactory       = projectionBufferFactory;
     _editorOperationsFactory       = editorOperationsFactory;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _editorFactory                 = editorFactory;
     _rtfBuilderService             = rtfBuilderService;
     _intellisenseSessionStackMap   = intellisenseSessionStackMap;
     _smartIndenterService          = smartIndenterService;
     _windowFactoryService          = windowFactoryService;
     _waitIndicator                 = waitIndicator;
 }
예제 #5
0
파일: VsVimHost.cs 프로젝트: 0-F/VsVim
        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            IWordUtilFactory wordUtilFactory,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            SVsServiceProvider serviceProvider)
            : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
        {
            _vsAdapter = adapter;
            _editorAdaptersFactoryService = editorAdaptersFactoryService;
            _wordUtilFactory = wordUtilFactory;
            _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _vsExtensibility = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
            _textManager = textManager;
            _sharedService = sharedServiceFactory.Create();
            _vsMonitorSelection = serviceProvider.GetService<SVsShellMonitorSelection, IVsMonitorSelection>();

            uint cookie;
            _vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
        }
예제 #6
0
        private EditFilter(
            IVsTextView vsTextView,
            ITextView textView,
            IEditorOperations editorOps,
            IServiceProvider serviceProvider,
            IComponentModel model,
            IOleCommandTarget next
            )
        {
            _vsTextView          = vsTextView;
            _textView            = textView;
            _editorOps           = editorOps;
            _serviceProvider     = serviceProvider;
            _componentModel      = model;
            _pyService           = _serviceProvider.GetPythonToolsService();
            _entryService        = _componentModel.GetService <AnalysisEntryService>();
            _undoManagerProvider = _componentModel.GetService <ITextBufferUndoManagerProvider>();
            _next = next;

            BraceMatcher.WatchBraceHighlights(textView, _componentModel);

            if (_next == null)
            {
                ErrorHandler.ThrowOnFailure(vsTextView.AddCommandFilter(this, out _next));
            }
        }
예제 #7
0
 public AbstractEncapsulateFieldCommandHandler(
     IWaitIndicator waitIndicator,
     ITextBufferUndoManagerProvider undoManager)
 {
     _waitIndicator = waitIndicator;
     _undoManager   = undoManager;
 }
 public EncapsulateFieldCommandHandler(
     IThreadingContext threadingContext,
     ITextBufferUndoManagerProvider undoManager,
     IAsynchronousOperationListenerProvider listenerProvider)
     : base(threadingContext, undoManager, listenerProvider)
 {
 }
예제 #9
0
 public InteractiveWindowProvider(
     IContentTypeRegistryService contentTypeRegistry,
     ITextBufferFactoryService bufferFactory,
     IProjectionBufferFactoryService projectionBufferFactory,
     IEditorOperationsFactoryService editorOperationsFactory,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextEditorFactoryService editorFactory,
     IRtfBuilderService rtfBuilderService,
     IIntellisenseSessionStackMapService intellisenseSessionStackMap,
     ISmartIndentationService smartIndenterService,
     IInteractiveWindowEditorFactoryService windowFactoryService,
     IWaitIndicator waitIndicator)
 {
     _contentTypeRegistry = contentTypeRegistry;
     _bufferFactory = bufferFactory;
     _projectionBufferFactory = projectionBufferFactory;
     _editorOperationsFactory = editorOperationsFactory;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _editorFactory = editorFactory;
     _rtfBuilderService = rtfBuilderService;
     _intellisenseSessionStackMap = intellisenseSessionStackMap;
     _smartIndenterService = smartIndenterService;
     _windowFactoryService = windowFactoryService;
     _waitIndicator = waitIndicator;
 }
예제 #10
0
 public ExpandCommand(IWpfTextView view, ICompletionBroker broker, ITextBufferUndoManagerProvider undoProvider, IClassifier classifier)
 {
     _view        = view;
     _broker      = broker;
     _undoManager = undoProvider.GetTextBufferUndoManager(view.TextBuffer);
     _classifier  = classifier;
 }
 public EncapsulateFieldCommandHandler(
     IWaitIndicator waitIndicator,
     ITextBufferUndoManagerProvider undoManager,
     IAsynchronousOperationListenerProvider listenerProvider)
     : base(waitIndicator, undoManager, listenerProvider)
 {
 }
 public ExtractMethodCommandHandler(
     IThreadingContext threadingContext,
     ITextBufferUndoManagerProvider undoManager,
     IInlineRenameService renameService)
     : base(threadingContext, undoManager, renameService)
 {
 }
예제 #13
0
 public ExtractMethodCommandHandler(
     ITextBufferUndoManagerProvider undoManager,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IInlineRenameService renameService)
     : base(undoManager, editorOperationsFactoryService, renameService)
 {
 }
예제 #14
0
파일: VsVimHost.cs 프로젝트: vadimi/VsVim
        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ISmartIndentationService smartIndentationService,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            IVimApplicationSettings vimApplicationSettings,
            IExtensionAdapterBroker extensionAdapterBroker,
            SVsServiceProvider serviceProvider)
            : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
        {
            _vsAdapter = adapter;
            _editorAdaptersFactoryService = editorAdaptersFactoryService;
            _dte                     = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _vsExtensibility         = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
            _textManager             = textManager;
            _sharedService           = sharedServiceFactory.Create();
            _vsMonitorSelection      = serviceProvider.GetService <SVsShellMonitorSelection, IVsMonitorSelection>();
            _vimApplicationSettings  = vimApplicationSettings;
            _smartIndentationService = smartIndentationService;
            _extensionAdapterBroker  = extensionAdapterBroker;

            uint cookie;

            _vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
        }
예제 #15
0
파일: VsVimHost.cs 프로젝트: pckben/VsVim
        internal VsVimHost(
            IVsAdapter adapter,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            ITextDocumentFactoryService textDocumentFactoryService,
            ITextBufferUndoManagerProvider undoManagerProvider,
            IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ITextManager textManager,
            ISharedServiceFactory sharedServiceFactory,
            SVsServiceProvider serviceProvider)
            : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
        {
            _vsAdapter = adapter;
            _editorAdaptersFactoryService = editorAdaptersFactoryService;
            _dte                = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _vsExtensibility    = (IVsExtensibility)serviceProvider.GetService(typeof(IVsExtensibility));
            _textManager        = textManager;
            _sharedService      = sharedServiceFactory.Create();
            _vsMonitorSelection = serviceProvider.GetService <SVsShellMonitorSelection, IVsMonitorSelection>();
            _fontProperties     = new TextEditorFontProperties(serviceProvider);

            uint cookie;

            _vsMonitorSelection.AdviseSelectionEvents(this, out cookie);
        }
 public BraceCompletionSessionProvider(
     ITextBufferUndoManagerProvider undoManager,
     IEditorOperationsFactoryService editorOperationsFactoryService)
 {
     _undoManager = undoManager;
     _editorOperationsFactoryService = editorOperationsFactoryService;
 }
 public AbstractEncapsulateFieldCommandHandler(
     ITextBufferUndoManagerProvider undoManager,
     IAsynchronousOperationListenerProvider listenerProvider)
 {
     _undoManager = undoManager;
     _listener    = listenerProvider.GetListener(FeatureAttribute.EncapsulateField);
 }
예제 #18
0
 public ExtractMethodCommandHandler(
     ITextBufferUndoManagerProvider undoManager,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IInlineRenameService renameService,
     IWaitIndicator waitIndicator) :
     base(undoManager, editorOperationsFactoryService, renameService, waitIndicator)
 {
 }
예제 #19
0
 public BraceCompletionContext(
     ISmartIndentationService smartIndentationService, ITextBufferUndoManagerProvider undoManager,
     HlslClassificationService classificationService, IHlslOptionsService optionsService)
 {
     _smartIndentationService = smartIndentationService;
     _undoManager             = undoManager;
     _classificationService   = classificationService;
     _optionsService          = optionsService;
 }
예제 #20
0
 public ExpandCommand(IWpfTextView view, ICompletionBroker broker, ITextBufferUndoManagerProvider undoProvider, IClassifier classifier)
 {
     ThreadHelper.ThrowIfNotOnUIThread();
     _view        = view;
     _broker      = broker;
     _undoManager = undoProvider.GetTextBufferUndoManager(view.TextBuffer);
     _classifier  = classifier;
     _dte         = Package.GetGlobalService(typeof(DTE)) as DTE;
 }
 public AbstractEncapsulateFieldCommandHandler(
     IWaitIndicator waitIndicator,
     ITextBufferUndoManagerProvider undoManager,
     IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners)
 {
     _waitIndicator = waitIndicator;
     _undoManager   = undoManager;
     _listener      = new AggregateAsynchronousOperationListener(asyncListeners, FeatureAttribute.EncapsulateField);
 }
예제 #22
0
 public BraceCompletionSessionProvider(
     IThreadingContext threadingContext,
     ITextBufferUndoManagerProvider undoManager,
     IEditorOperationsFactoryService editorOperationsFactoryService)
     : base(threadingContext)
 {
     _undoManager = undoManager;
     _editorOperationsFactoryService = editorOperationsFactoryService;
 }
예제 #23
0
 public PythonPasteCommandHandler(
     [Import(typeof(SVsServiceProvider))] IServiceProvider site,
     [Import] IEditorOperationsFactoryService editOperationsFactory,
     [Import] ITextBufferUndoManagerProvider undoManagerFactory
     )
 {
     _site = site;
     _editOperationsFactory = editOperationsFactory;
     _undoManagerFactory    = undoManagerFactory;
 }
예제 #24
0
 internal VsVimHost(
     ITextBufferUndoManagerProvider undoManagerProvider,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     SVsServiceProvider serviceProvider)
 {
     _undoManagerProvider = undoManagerProvider;
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
     _textManager = (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager));
 }
예제 #25
0
 public TextViewUndoManager(IDsWpfTextView textView, ITextViewUndoManagerProvider textViewUndoManagerProvider, ITextBufferUndoManagerProvider textBufferUndoManagerProvider)
 {
     TextView = textView ?? throw new ArgumentNullException(nameof(textView));
     this.textViewUndoManagerProvider   = textViewUndoManagerProvider ?? throw new ArgumentNullException(nameof(textViewUndoManagerProvider));
     this.textBufferUndoManagerProvider = textBufferUndoManagerProvider ?? throw new ArgumentNullException(nameof(textBufferUndoManagerProvider));
     textBufferUndoManager       = textBufferUndoManagerProvider.GetTextBufferUndoManager(TextView.TextBuffer);
     undoRedoCommandTargetFilter = new UndoRedoCommandTargetFilter(this);
     TextView.CommandTarget.AddFilter(undoRedoCommandTargetFilter, CommandTargetFilterOrder.UndoRedo);
     TextView.Closed += TextView_Closed;
 }
        public AbstractExtractMethodCommandHandler(
            ITextBufferUndoManagerProvider undoManager,
            IInlineRenameService renameService)
        {
            Contract.ThrowIfNull(undoManager);
            Contract.ThrowIfNull(renameService);

            _undoManager   = undoManager;
            _renameService = renameService;
        }
예제 #27
0
 public Services(
     IEditorOptionsFactoryService editorOptionsFactory, 
     IEditorOperationsFactoryService editorOperatiosnFactoryService,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextDocumentFactoryService textDocumentFactoryService)
 {
     _editorOptionsFactory = editorOptionsFactory;
     _editorOperationsFactoryService = editorOperatiosnFactoryService;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _textDocumentFactoryService = textDocumentFactoryService;
 }
 public BraceCompletionContext(
     ISmartIndentationService smartIndentationService, ITextBufferUndoManagerProvider undoManager, 
     HlslClassificationService classificationService, IOptionsService optionsService,
     VisualStudioSourceTextFactory sourceTextFactory)
 {
     _smartIndentationService = smartIndentationService;
     _undoManager = undoManager;
     _classificationService = classificationService;
     _optionsService = optionsService;
     _sourceTextFactory = sourceTextFactory;
 }
예제 #29
0
 public AbstractEncapsulateFieldCommandHandler(
     IThreadingContext threadingContext,
     ITextBufferUndoManagerProvider undoManager,
     IGlobalOptionService globalOptions,
     IAsynchronousOperationListenerProvider listenerProvider)
 {
     _threadingContext = threadingContext;
     _undoManager      = undoManager;
     _globalOptions    = globalOptions;
     _listener         = listenerProvider.GetListener(FeatureAttribute.EncapsulateField);
 }
예제 #30
0
 public Services(
     IEditorOptionsFactoryService editorOptionsFactory,
     IEditorOperationsFactoryService editorOperatiosnFactoryService,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextDocumentFactoryService textDocumentFactoryService)
 {
     _editorOptionsFactory           = editorOptionsFactory;
     _editorOperationsFactoryService = editorOperatiosnFactoryService;
     _textBufferUndoManagerProvider  = textBufferUndoManagerProvider;
     _textDocumentFactoryService     = textDocumentFactoryService;
 }
예제 #31
0
 public BraceCompletionSessionProvider(
     IThreadingContext threadingContext,
     ITextBufferUndoManagerProvider undoManager,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IGlobalOptionService globalOptions)
 {
     _threadingContext = threadingContext;
     _undoManager      = undoManager;
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _globalOptions = globalOptions;
 }
예제 #32
0
        public CompoundUndoAction(ITextView textView, IEditorShell editorShell, bool addRollbackOnCancel = true)
        {
            if (!editorShell.IsUnitTestEnvironment)
            {
                IEditorOperationsFactoryService operationsService = editorShell.GlobalServices.GetService <IEditorOperationsFactoryService>();
                ITextBufferUndoManagerProvider  undoProvider      = editorShell.GlobalServices.GetService <ITextBufferUndoManagerProvider>();

                _editorOperations    = operationsService.GetEditorOperations(textView);
                _undoManager         = undoProvider.GetTextBufferUndoManager(_editorOperations.TextView.TextBuffer);
                _addRollbackOnCancel = addRollbackOnCancel;
            }
        }
예제 #33
0
        public SelectionUndo(ISelectionTracker selectionTracker, ITextBufferUndoManagerProvider undoManagerProvider, string transactionName, bool automaticTracking)
        {
            _selectionTracker = selectionTracker;
            var undoManager = undoManagerProvider.GetTextBufferUndoManager(selectionTracker.TextView.TextBuffer);

            ITextUndoTransaction innerTransaction = undoManager.TextBufferUndoHistory.CreateTransaction(transactionName);

            _transaction = new TextUndoTransactionThatRollsBackProperly(innerTransaction);
            _transaction.AddUndo(new StartSelectionTrackingUndoUnit(selectionTracker));

            _selectionTracker.StartTracking(automaticTracking);
        }
예제 #34
0
        public CompoundUndoAction(ITextView textView, ITextBuffer textBuffer, bool addRollbackOnCancel = true)
        {
            if (!EditorShell.Current.IsUnitTestEnvironment)
            {
                IEditorOperationsFactoryService operationsService = EditorShell.Current.ExportProvider.GetExport <IEditorOperationsFactoryService>().Value;
                ITextBufferUndoManagerProvider  undoProvider      = EditorShell.Current.ExportProvider.GetExport <ITextBufferUndoManagerProvider>().Value;

                _editorOperations    = operationsService.GetEditorOperations(textView);
                _undoManager         = undoProvider.GetTextBufferUndoManager(_editorOperations.TextView.TextBuffer);
                _addRollbackOnCancel = addRollbackOnCancel;
            }
        }
예제 #35
0
        public AbstractExtractMethodCommandHandler(
            ITextBufferUndoManagerProvider undoManager,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            IInlineRenameService renameService)
        {
            Contract.ThrowIfNull(undoManager);
            Contract.ThrowIfNull(editorOperationsFactoryService);
            Contract.ThrowIfNull(renameService);

            _undoManager = undoManager;
            _editorOperationsFactoryService = editorOperationsFactoryService;
            _renameService = renameService;
        }
 public TextViewHookHelper(
     IVsEditorAdaptersFactoryService adaptersFactory,
     IEditorOptionsFactoryService editorOptionsFactory,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextDocumentFactoryService textDocumentFactoryService)
 {
     _adaptersFactory                = adaptersFactory;
     _editorOptionsFactory           = editorOptionsFactory;
     _editorOperationsFactorySerivce = editorOperationsFactoryService;
     _textBufferUndoManagerProvider  = textBufferUndoManagerProvider;
     _textDocumentFactoryService     = textDocumentFactoryService;
 }
 public CodeFormattingHookHelper(
     IVsEditorAdaptersFactoryService adaptersFactory, 
     IEditorOptionsFactoryService editorOptionsFactory,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextDocumentFactoryService textDocumentFactoryService)
 {
     _adaptersFactory = adaptersFactory;
     _editorOptionsFactory = editorOptionsFactory;
     _editorOperationsFactorySerivce = editorOperationsFactoryService;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _textDocumentFactoryService = textDocumentFactoryService;
 }
예제 #38
0
파일: VsVimHost.cs 프로젝트: rride/VsVim
 internal VsVimHost(
     IVsAdapter adapter,
     ITextBufferUndoManagerProvider undoManagerProvider,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     ITextManager textManager,
     ITextDocumentFactoryService textDocumentFactoryService,
     SVsServiceProvider serviceProvider)
     : base(textDocumentFactoryService)
 {
     _adapter = adapter;
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
     _textManager = textManager;
 }
예제 #39
0
 /// <summary>
 /// Default session with a language specific context
 /// </summary>
 public BraceCompletionDefaultSession(ITextView textView, ITextBuffer subjectBuffer,
                                      SnapshotPoint openingPoint, char openingBrace, char closingBrace, ITextBufferUndoManagerProvider undoManager,
                                      IEditorOperationsFactoryService editorOperationsFactoryService, IBraceCompletionContext context)
 {
     _textView         = textView;
     _subjectBuffer    = subjectBuffer;
     _openingBrace     = openingBrace;
     _closingBrace     = closingBrace;
     _closingPoint     = SubjectBuffer.CurrentSnapshot.CreateTrackingPoint(openingPoint.Position, PointTrackingMode.Positive);
     _context          = context;
     _undoManager      = undoManager;
     _undoHistory      = undoManager.GetTextBufferUndoManager(_textView.TextBuffer).TextBufferUndoHistory;
     _editorOperations = editorOperationsFactoryService.GetEditorOperations(_textView);
 }
 public CodeFormattingHookHelper(
     IVsEditorAdaptersFactoryService adaptersFactory, 
     IEditorOptionsFactoryService editorOptionsFactory,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextDocumentFactoryService textDocumentFactoryService,
     [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
 {
     _adaptersFactory = adaptersFactory;
     _editorOptionsFactory = editorOptionsFactory;
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _textDocumentFactoryService = textDocumentFactoryService;
     _serviceProvider = serviceProvider;
 }
예제 #41
0
		public TextViewUndoManager(IDsWpfTextView textView, ITextViewUndoManagerProvider textViewUndoManagerProvider, ITextBufferUndoManagerProvider textBufferUndoManagerProvider) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (textViewUndoManagerProvider == null)
				throw new ArgumentNullException(nameof(textViewUndoManagerProvider));
			if (textBufferUndoManagerProvider == null)
				throw new ArgumentNullException(nameof(textBufferUndoManagerProvider));
			TextView = textView;
			this.textViewUndoManagerProvider = textViewUndoManagerProvider;
			this.textBufferUndoManagerProvider = textBufferUndoManagerProvider;
			textBufferUndoManager = textBufferUndoManagerProvider.GetTextBufferUndoManager(TextView.TextBuffer);
			undoRedoCommandTargetFilter = new UndoRedoCommandTargetFilter(this);
			TextView.CommandTarget.AddFilter(undoRedoCommandTargetFilter, CommandTargetFilterOrder.UndoRedo);
			TextView.Closed += TextView_Closed;
		}
예제 #42
0
        public AbstractExtractMethodCommandHandler(
            IThreadingContext threadingContext,
            ITextBufferUndoManagerProvider undoManager,
            IInlineRenameService renameService,
            IGlobalOptionService globalOptions)
        {
            Contract.ThrowIfNull(threadingContext);
            Contract.ThrowIfNull(undoManager);
            Contract.ThrowIfNull(renameService);

            _threadingContext = threadingContext;
            _undoManager      = undoManager;
            _renameService    = renameService;
            _globalOptions    = globalOptions;
        }
예제 #43
0
 internal VsVimHost(
     IVsAdapter adapter,
     ITextBufferUndoManagerProvider undoManagerProvider,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     ITextManager textManager,
     ITextDocumentFactoryService textDocumentFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     SVsServiceProvider serviceProvider)
     : base(textDocumentFactoryService, editorOperationsFactoryService)
 {
     _adapter = adapter;
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _dte         = (_DTE)serviceProvider.GetService(typeof(_DTE));
     _textManager = textManager;
 }
예제 #44
0
파일: VsVimHost.cs 프로젝트: rschatz/VsVim
 internal VsVimHost(
     IVsAdapter adapter,
     ITextBufferFactoryService textBufferFactoryService,
     ITextEditorFactoryService textEditorFactoryService,
     ITextDocumentFactoryService textDocumentFactoryService,
     ITextBufferUndoManagerProvider undoManagerProvider,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IWordUtilFactory wordUtilFactory,
     ITextManager textManager,
     SVsServiceProvider serviceProvider)
     : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
 {
     _vsAdapter = adapter;
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _wordUtilFactory = wordUtilFactory;
     _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
     _textManager = textManager;
 }
 public CodeFormattingHookHelper(
     [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider, 
     IVsEditorAdaptersFactoryService adaptersFactory, 
     IEditorOptionsFactoryService editorOptionsFactory,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextDocumentFactoryService textDocumentFactoryService,
     ProjectFactory projectFactory,
     VSLanguageService vsLanguageService,
     IOpenDocumentsTracker openDocumentTracker)
 {
     _serviceProvider = serviceProvider;
     _adaptersFactory = adaptersFactory;
     _editorOptionsFactory = editorOptionsFactory;
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _textDocumentFactoryService = textDocumentFactoryService;
     _projectFactory = projectFactory;
     _vsLanguageService = vsLanguageService;
     _openDocumentTracker = openDocumentTracker;
 }
            public UIThreadOnly(
                InteractiveWindow window,
                IInteractiveWindowEditorFactoryService factory,
                IContentTypeRegistryService contentTypeRegistry,
                ITextBufferFactoryService bufferFactory,
                IProjectionBufferFactoryService projectionBufferFactory,
                IEditorOperationsFactoryService editorOperationsFactory,
                ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
                ITextEditorFactoryService editorFactory,
                IRtfBuilderService rtfBuilderService,
                IIntellisenseSessionStackMapService intellisenseSessionStackMap,
                ISmartIndentationService smartIndenterService,
                IInteractiveEvaluator evaluator,
                IWaitIndicator waitIndicator)
            {
                _window = window;
                _factory = factory;
                _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
                _rtfBuilderService = (IRtfBuilderService2)rtfBuilderService;
                _intellisenseSessionStackMap = intellisenseSessionStackMap;
                _smartIndenterService = smartIndenterService;
                _waitIndicator = waitIndicator;
                Evaluator = evaluator;

                var replContentType = contentTypeRegistry.GetContentType(PredefinedInteractiveContentTypes.InteractiveContentTypeName);
                var replOutputContentType = contentTypeRegistry.GetContentType(PredefinedInteractiveContentTypes.InteractiveOutputContentTypeName);

                OutputBuffer = bufferFactory.CreateTextBuffer(replOutputContentType);
                StandardInputBuffer = bufferFactory.CreateTextBuffer();
                _standardInputStart = 0;
                _inertType = bufferFactory.InertContentType;

                _projectionBuffer = projectionBufferFactory.CreateProjectionBuffer(
                    new EditResolver(window),
                    Array.Empty<object>(),
                    ProjectionBufferOptions.None,
                    replContentType);

                _projectionBuffer.Properties.AddProperty(typeof(InteractiveWindow), window);

                AppendNewOutputProjectionBuffer();
                _projectionBuffer.Changed += new EventHandler<TextContentChangedEventArgs>(ProjectionBufferChanged);

                var roleSet = editorFactory.CreateTextViewRoleSet(
                    PredefinedTextViewRoles.Analyzable,
                    PredefinedTextViewRoles.Editable,
                    PredefinedTextViewRoles.Interactive,
                    PredefinedTextViewRoles.Zoomable,
                    PredefinedInteractiveTextViewRoles.InteractiveTextViewRole);

                TextView = factory.CreateTextView(window, _projectionBuffer, roleSet);
                TextView.Caret.PositionChanged += CaretPositionChanged;

                var options = TextView.Options;
                options.SetOptionValue(DefaultTextViewHostOptions.HorizontalScrollBarId, true);
                options.SetOptionValue(DefaultTextViewHostOptions.LineNumberMarginId, false);
                options.SetOptionValue(DefaultTextViewHostOptions.OutliningMarginId, false);
                options.SetOptionValue(DefaultTextViewHostOptions.GlyphMarginId, false);
                options.SetOptionValue(DefaultTextViewOptions.WordWrapStyleId, WordWrapStyles.None);

                _lineBreakString = options.GetNewLineCharacter();
                EditorOperations = editorOperationsFactory.GetEditorOperations(TextView);

                _buffer = new OutputBuffer(window);
                OutputWriter = new InteractiveWindowWriter(window, spans: null);

                SortedSpans errorSpans = new SortedSpans();
                ErrorOutputWriter = new InteractiveWindowWriter(window, errorSpans);
                OutputClassifierProvider.AttachToBuffer(OutputBuffer, errorSpans);
            }
예제 #47
0
파일: VsVimHost.cs 프로젝트: ameent/VsVim
 internal VsVimHost(ITextBufferUndoManagerProvider undoManagerProvider, IVsEditorAdaptersFactoryService editorAdaptersFactoryService)
 {
     _undoManagerProvider = undoManagerProvider;
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
 }
 public CurlyBraceCompletionSession(ISyntaxFactsService syntaxFactsService, ISmartIndentationService smartIndentationService, ITextBufferUndoManagerProvider undoManager)
     : base(syntaxFactsService, (int)SyntaxKind.OpenBraceToken, (int)SyntaxKind.CloseBraceToken)
 {
     _smartIndentationService = smartIndentationService;
     _undoManager = undoManager;
 }
 public CSharpEditorBraceCompletionSessionFactory(ISmartIndentationService smartIndentationService, ITextBufferUndoManagerProvider undoManager)
 {
     _smartIndentationService = smartIndentationService;
     _undoManager = undoManager;
 }
예제 #50
0
 public virtual void SetupBase()
 {
     _compositionContainer = GetOrCreateCompositionContainer();
     _textBufferFactoryService = _compositionContainer.GetExportedValue<ITextBufferFactoryService>();
     _textEditorFactoryService = _compositionContainer.GetExportedValue<ITextEditorFactoryService>();
     _smartIndentationService = _compositionContainer.GetExportedValue<ISmartIndentationService>();
     _editorOperationsFactoryService = _compositionContainer.GetExportedValue<IEditorOperationsFactoryService>();
     _editorOptionsFactoryService = _compositionContainer.GetExportedValue<IEditorOptionsFactoryService>();
     _textSearchService = _compositionContainer.GetExportedValue<ITextSearchService>();
     _outliningManagerService = _compositionContainer.GetExportedValue<IOutliningManagerService>();
     _textBufferUndoManagerProvider = _compositionContainer.GetExportedValue<ITextBufferUndoManagerProvider>();
     _contentTypeRegistryService = _compositionContainer.GetExportedValue<IContentTypeRegistryService>();
     _adhocOutlinerFactory = _compositionContainer.GetExportedValue<IAdhocOutlinerFactory>();
     _taggerFactory = _compositionContainer.GetExportedValue<ITaggerFactory>();
 }
 public EncapsulateFieldCommandHandler(
     IWaitIndicator waitIndicator,
     ITextBufferUndoManagerProvider undoManager)
     : base(waitIndicator, undoManager)
 {
 }
		TextViewUndoManagerProvider(ITextBufferUndoManagerProvider textBufferUndoManagerProvider) {
			this.textBufferUndoManagerProvider = textBufferUndoManagerProvider;
		}
예제 #53
0
 internal VimErrorDetector(ITextBufferUndoManagerProvider textBufferUndoManagerProvider)
 {
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
 }
예제 #54
0
 internal VimErrorDetector(IVim vim, IBufferTrackingService bufferTrackingService, ITextBufferUndoManagerProvider textBufferUndoManagerProvider)
 {
     _vim = vim;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _bufferTrackingService = bufferTrackingService;
 }