public AutomaticLineEnderCommandHandler(
     IWaitIndicator waitIndicator,
     ITextUndoHistoryRegistry undoRegistry,
     IEditorOperationsFactoryService editorOperations)
     : base(waitIndicator, undoRegistry, editorOperations)
 {
 }
Exemplo n.º 2
0
		public WpfTextViewHost(IWpfTextViewMarginProviderCollectionProvider wpfTextViewMarginProviderCollectionProvider, IDsWpfTextView wpfTextView, IEditorOperationsFactoryService editorOperationsFactoryService, bool setFocus) {
			if (wpfTextViewMarginProviderCollectionProvider == null)
				throw new ArgumentNullException(nameof(wpfTextViewMarginProviderCollectionProvider));
			if (wpfTextView == null)
				throw new ArgumentNullException(nameof(wpfTextView));
			if (editorOperationsFactoryService == null)
				throw new ArgumentNullException(nameof(editorOperationsFactoryService));
			this.editorOperationsFactoryService = editorOperationsFactoryService;
			grid = CreateGrid();
			TextView = wpfTextView;
			Focusable = false;
			Content = grid;

			UpdateBackground();
			TextView.BackgroundBrushChanged += TextView_BackgroundBrushChanged;

			containerMargins = new IWpfTextViewMargin[5];
			containerMargins[0] = CreateContainerMargin(wpfTextViewMarginProviderCollectionProvider, PredefinedMarginNames.Top, true, 0, 0, 3);
			containerMargins[1] = CreateContainerMargin(wpfTextViewMarginProviderCollectionProvider, PredefinedMarginNames.Bottom, true, 2, 0, 2);
			containerMargins[2] = CreateContainerMargin(wpfTextViewMarginProviderCollectionProvider, PredefinedMarginNames.BottomRightCorner, true, 2, 2, 1);
			containerMargins[3] = CreateContainerMargin(wpfTextViewMarginProviderCollectionProvider, PredefinedMarginNames.Left, false, 1, 0, 1);
			containerMargins[4] = CreateContainerMargin(wpfTextViewMarginProviderCollectionProvider, PredefinedMarginNames.Right, false, 1, 2, 1);
			Add(TextView.VisualElement, 1, 1, 1);
			Debug.Assert(!containerMargins.Any(a => a == null));

			if (setFocus) {
				Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() => {
					if (!TextView.IsClosed)
						TextView.VisualElement.Focus();
				}));
			}
		}
Exemplo n.º 3
0
 protected VimHost(
     ITextDocumentFactoryService textDocumentFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService)
 {
     _textDocumentFactoryService = textDocumentFactoryService;
     _editorOperationsFactoryService = editorOperationsFactoryService;
 }
 public SmartTokenFormatterCommandHandler(
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IEditorOperationsFactoryService editorOperationsFactoryService) :
     base(undoHistoryRegistry,
          editorOperationsFactoryService)
 {
 }
Exemplo n.º 5
0
 public CodeWindowManager(IVsCodeWindow codeWindow, IWpfTextView textView, IComponentModel componentModel)
 {
     _window = codeWindow;
     _textView = textView;
     _editorOperationsFactory = componentModel.GetService<IEditorOperationsFactoryService>();
     _analyzer = componentModel.GetService<IPythonAnalyzer>();
 }
Exemplo n.º 6
0
 public CodeWindowManager(IVsCodeWindow codeWindow, IWpfTextView textView, IComponentModel componentModel)
 {
     _window = codeWindow;
     _textView = textView;
     _editorOperationsFactory = componentModel.GetService<IEditorOperationsFactoryService>();
     _textView.Properties.AddProperty(typeof(CodeWindowManager), this);
 }
Exemplo n.º 7
0
        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);
        }
Exemplo n.º 8
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 ReplWindowTextViewCreationListener(IVsEditorAdaptersFactoryService adaptersFactory, IEditorOperationsFactoryService editorOperationsFactory, [Import(typeof(SVsServiceProvider))]IServiceProvider serviceProvider, IEditorOptionsFactoryService editorOptionsFactory) {
     _serviceProvider = serviceProvider;
     _adaptersFactory = adaptersFactory;
     _editorOperationsFactory = editorOperationsFactory;
     _compModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));
     _editorOptionsFactory = editorOptionsFactory;
 }
 public BraceCompletionSessionProvider(
     ITextBufferUndoManagerProvider undoManager,
     IEditorOperationsFactoryService editorOperationsFactoryService)
 {
     _undoManager = undoManager;
     _editorOperationsFactoryService = editorOperationsFactoryService;
 }
Exemplo n.º 11
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;
 }
Exemplo n.º 12
0
 public ExtractMethodCommandHandler(
     ITextBufferUndoManagerProvider undoManager,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IInlineRenameService renameService,
     IWaitIndicator waitIndicator) :
     base(undoManager, editorOperationsFactoryService, renameService, waitIndicator)
 {
 }
Exemplo n.º 13
0
		public OutputBufferVM(IEditorOperationsFactoryService editorOperationsFactoryService, Guid guid, string name, ILogEditor logEditor) {
			editorOperations = editorOperationsFactoryService.GetEditorOperations(logEditor.TextView);
			Guid = guid;
			Name = name;
			this.logEditor = logEditor;
			index = -1;
			needTimestamp = true;
		}
Exemplo n.º 14
0
		SearchServiceProvider(ITextSearchService2 textSearchService2, ITextStructureNavigatorSelectorService textStructureNavigatorSelectorService, ISearchSettings searchSettings, IMessageBoxService messageBoxService, [ImportMany] IEnumerable<Lazy<IReplaceListenerProvider>> replaceListenerProviders, IEditorOperationsFactoryService editorOperationsFactoryService) {
			this.textSearchService2 = textSearchService2;
			this.textStructureNavigatorSelectorService = textStructureNavigatorSelectorService;
			this.searchSettings = searchSettings;
			this.messageBoxService = messageBoxService;
			this.replaceListenerProviders = replaceListenerProviders.ToArray();
			this.editorOperationsFactoryService = editorOperationsFactoryService;
		}
Exemplo n.º 15
0
 /// <summary>
 /// create caret preserving edit transaction with automatic code change undo merging policy
 /// </summary>
 public static CaretPreservingEditTransaction CreateEditTransaction(
     this ITextView view, string description, ITextUndoHistoryRegistry registry, IEditorOperationsFactoryService service)
 {
     return new CaretPreservingEditTransaction(description, view, registry, service)
     {
         MergePolicy = AutomaticCodeChangeMergePolicy.Instance
     };
 }
Exemplo n.º 16
0
 internal VimHostImpl(
     ITextBufferFactoryService textBufferFactoryService,
     ITextEditorFactoryService textEditorFactoryService,
     ITextDocumentFactoryService textDocumentFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService) :
     base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
 {
 }
 public TestInteractiveCommandHandler(
     IInteractiveWindow interactiveWindow,
     IContentTypeRegistryService contentTypeRegistryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService)
     : base(contentTypeRegistryService, editorOptionsFactoryService, editorOperationsFactoryService)
 {
     _interactiveWindow = interactiveWindow;
 }
Exemplo n.º 18
0
 public RenameCommandHandler(
     InlineRenameService renameService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IWaitIndicator waitIndicator)
 {
     _renameService = renameService;
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _waitIndicator = waitIndicator;
 }
 public CSharpInteractiveCommandHandler(
     CSharpVsInteractiveWindowProvider interactiveWindowProvider,
     IContentTypeRegistryService contentTypeRegistryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService)
     : base(contentTypeRegistryService, editorOptionsFactoryService, editorOperationsFactoryService)
 {
     _interactiveWindowProvider = interactiveWindowProvider;
 }
		public TextViewMouseProcessorCollection(IWpfTextView wpfTextView, Lazy<IMouseProcessorProvider, IOrderableContentTypeAndTextViewRoleMetadata>[] mouseProcessorProviders, IEditorOperationsFactoryService editorOperationsFactoryService) {
			this.wpfTextView = wpfTextView;
			dsWpfTextView = wpfTextView as IDsWpfTextViewImpl;
			this.mouseProcessorProviders = mouseProcessorProviders;
			this.editorOperationsFactoryService = editorOperationsFactoryService;
			allowEventDelegate = AllowMouseEvent;
			wpfTextView.Closed += WpfTextView_Closed;
			wpfTextView.TextDataModel.ContentTypeChanged += TextDataModel_ContentTypeChanged;
			Reinitialize();
		}
 public CSharpInteractiveCommandHandler(
     CSharpVsInteractiveWindowProvider interactiveWindowProvider,
     IContentTypeRegistryService contentTypeRegistryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IWaitIndicator waitIndicator)
     : base(contentTypeRegistryService, editorOptionsFactoryService, editorOperationsFactoryService, waitIndicator)
 {
     _interactiveWindowProvider = interactiveWindowProvider;
     _sendToInteractiveSubmissionProvider = new CSharpSendToInteractiveSubmissionProvider();
 }
Exemplo n.º 22
0
 public RHistoryProvider(ITextBufferFactoryService textBufferFactory, IContentTypeRegistryService contentTypeRegistryService, IFileSystem fileSystem, IEditorOperationsFactoryService editorOperationsFactory, IRtfBuilderService rtfBuilderService, ITextSearchService2 textSearchService, IRSettings settings) {
     _textBufferFactory = textBufferFactory;
     _fileSystem = fileSystem;
     _editorOperationsFactory = editorOperationsFactory;
     _rtfBuilderService = rtfBuilderService;
     _textSearchService = textSearchService;
     _settings = settings;
     _rtfBuilderService = rtfBuilderService;
     _contentType = contentTypeRegistryService.GetContentType(RHistoryContentTypeDefinition.ContentType);
     _histories = new Dictionary<ITextBuffer, IRHistory>();
 }
Exemplo n.º 23
0
		ReplEditorProvider(IDsTextEditorFactoryService dsTextEditorFactoryService, IContentTypeRegistryService contentTypeRegistryService, ITextBufferFactoryService textBufferFactoryService, IEditorOperationsFactoryService editorOperationsFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, IClassificationTypeRegistryService classificationTypeRegistryService, IThemeClassificationTypeService themeClassificationTypeService, IPickSaveFilename pickSaveFilename, ITextViewUndoManagerProvider textViewUndoManagerProvider) {
			this.dsTextEditorFactoryService = dsTextEditorFactoryService;
			this.contentTypeRegistryService = contentTypeRegistryService;
			this.textBufferFactoryService = textBufferFactoryService;
			this.editorOperationsFactoryService = editorOperationsFactoryService;
			this.editorOptionsFactoryService = editorOptionsFactoryService;
			this.classificationTypeRegistryService = classificationTypeRegistryService;
			this.themeClassificationTypeService = themeClassificationTypeService;
			this.pickSaveFilename = pickSaveFilename;
			this.textViewUndoManagerProvider = textViewUndoManagerProvider;
		}
Exemplo n.º 24
0
 public Services(
     IEditorOptionsFactoryService editorOptionsFactory, 
     IEditorOperationsFactoryService editorOperatiosnFactoryService,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextDocumentFactoryService textDocumentFactoryService)
 {
     _editorOptionsFactory = editorOptionsFactory;
     _editorOperationsFactoryService = editorOperatiosnFactoryService;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _textDocumentFactoryService = textDocumentFactoryService;
 }
Exemplo n.º 25
0
 public AutoCommentService(
     [Import] IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     [Import] IEditorOperationsFactoryService editorOperationsFactoryService,
     [Import] ITextUndoHistoryRegistry textUndoHistoryRegistry,
     [ImportMany] IEnumerable<Lazy<ICommenterProvider, IContentTypeMetadata>> commenterProviders)
 {
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _textUndoHistoryRegistry = textUndoHistoryRegistry;
     _commenterProviders = commenterProviders.ToList();
 }
Exemplo n.º 26
0
		public IncrementalSearch(ITextView textView, ITextSearchService textSearchService, IEditorOperationsFactoryService editorOperationsFactoryService) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (textSearchService == null)
				throw new ArgumentNullException(nameof(textSearchService));
			if (editorOperationsFactoryService == null)
				throw new ArgumentNullException(nameof(editorOperationsFactoryService));
			TextView = textView;
			this.textSearchService = textSearchService;
			editorOperations = editorOperationsFactoryService.GetEditorOperations(textView);
			SearchString = string.Empty;
		}
        public static CaretPreservingEditTransaction TryCreate(string description, 
            ITextView textView,
            ITextUndoHistoryRegistry undoHistoryRegistry,
            IEditorOperationsFactoryService editorOperationsFactoryService)
        {
            if (undoHistoryRegistry.TryGetHistory(textView.TextBuffer, out var unused))
            {
                return new CaretPreservingEditTransaction(description, textView, undoHistoryRegistry, editorOperationsFactoryService);
            }

            return null;
        }
 public CodeFormattingHookHelper(
     IVsEditorAdaptersFactoryService adaptersFactory, 
     IEditorOptionsFactoryService editorOptionsFactory,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextDocumentFactoryService textDocumentFactoryService)
 {
     _adaptersFactory = adaptersFactory;
     _editorOptionsFactory = editorOptionsFactory;
     _editorOperationsFactorySerivce = editorOperationsFactoryService;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _textDocumentFactoryService = textDocumentFactoryService;
 }
Exemplo n.º 29
0
 public AsyncCompletionService(
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IInlineRenameService inlineRenameService,
     [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners,
     [ImportMany] IEnumerable<Lazy<IIntelliSensePresenter<ICompletionPresenterSession, ICompletionSession>, OrderableMetadata>> completionPresenters,
     [ImportMany] IEnumerable<Lazy<ICompletionProvider, OrderableLanguageMetadata>> allCompletionProviders,
     [ImportMany] IEnumerable<Lazy<IBraceCompletionSessionProvider, IBraceCompletionMetadata>> autoBraceCompletionChars)
     : this(editorOperationsFactoryService, undoHistoryRegistry, inlineRenameService,
           ExtensionOrderer.Order(completionPresenters).Select(lazy => lazy.Value).FirstOrDefault(),
           asyncListeners, allCompletionProviders, autoBraceCompletionChars)
 {
 }
 public BraceCompletionSession(
     ITextView textView, ITextBuffer subjectBuffer,
     SnapshotPoint openingPoint, char openingBrace, char closingBrace, ITextUndoHistory undoHistory,
     IEditorOperationsFactoryService editorOperationsFactoryService, IEditorBraceCompletionSession session)
 {
     this.TextView = textView;
     this.SubjectBuffer = subjectBuffer;
     this.OpeningBrace = openingBrace;
     this.ClosingBrace = closingBrace;
     this.ClosingPoint = SubjectBuffer.CurrentSnapshot.CreateTrackingPoint(openingPoint.Position, PointTrackingMode.Positive);
     _undoHistory = undoHistory;
     _editorOperations = editorOperationsFactoryService.GetEditorOperations(textView);
     _session = session;
 }
Exemplo n.º 31
0
 public Controller(
     IThreadingContext threadingContext,
     ITextView textView,
     ITextBuffer subjectBuffer,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IIntelliSensePresenter <ICompletionPresenterSession, ICompletionSession> presenter,
     IAsynchronousOperationListener asyncListener,
     ImmutableHashSet <char> autoBraceCompletionChars,
     bool isDebugger,
     bool isImmediateWindow)
     : base(threadingContext, textView, subjectBuffer, presenter, asyncListener, null, "Completion")
 {
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _undoHistoryRegistry            = undoHistoryRegistry;
     _autoBraceCompletionChars       = autoBraceCompletionChars;
     _isDebugger        = isDebugger;
     _isImmediateWindow = isImmediateWindow;
     _roles             = textView.Roles.ToImmutableHashSet();
 }
Exemplo n.º 32
0
 public Controller(
     ITextView textView,
     ITextBuffer subjectBuffer,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IIntelliSensePresenter <ICompletionPresenterSession, ICompletionSession> presenter,
     IAsynchronousOperationListener asyncListener,
     IEnumerable <Lazy <CompletionListProvider, OrderableLanguageAndRoleMetadata> > allCompletionProviders,
     ImmutableHashSet <char> autoBraceCompletionChars,
     bool isDebugger,
     bool isImmediateWindow)
     : base(textView, subjectBuffer, presenter, asyncListener, null, "Completion")
 {
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _undoHistoryRegistry            = undoHistoryRegistry;
     _allCompletionProviders         = allCompletionProviders;
     _autoBraceCompletionChars       = autoBraceCompletionChars;
     _isDebugger        = isDebugger;
     _isImmediateWindow = isImmediateWindow;
 }
Exemplo n.º 33
0
        internal static Controller GetInstance(
            ITextView textView,
            ITextBuffer subjectBuffer,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            ITextUndoHistoryRegistry undoHistoryRegistry,
            IIntelliSensePresenter <ICompletionPresenterSession, ICompletionSession> presenter,
            IAsynchronousOperationListener asyncListener,
            IEnumerable <Lazy <CompletionListProvider, OrderableLanguageAndRoleMetadata> > allCompletionProviders,
            ImmutableHashSet <char> autoBraceCompletionChars)
        {
            var debuggerTextView  = textView as IDebuggerTextView;
            var isDebugger        = debuggerTextView != null;
            var isImmediateWindow = isDebugger && debuggerTextView.IsImmediateWindow;

            return(textView.GetOrCreatePerSubjectBufferProperty(subjectBuffer, s_controllerPropertyKey,
                                                                (v, b) => new Controller(textView, subjectBuffer, editorOperationsFactoryService, undoHistoryRegistry,
                                                                                         presenter, asyncListener,
                                                                                         allCompletionProviders, autoBraceCompletionChars,
                                                                                         isDebugger, isImmediateWindow)));
        }
Exemplo n.º 34
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,
            IExtensionAdapterBroker extensionAdapterBroker,
            IProtectedOperations protectedOperations,
            IMarkDisplayUtil markDisplayUtil,
            IControlCharUtil controlCharUtil,
            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;
            _runningDocumentTable    = serviceProvider.GetService <SVsRunningDocumentTable, IVsRunningDocumentTable>();
            _vsShell                 = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            _protectedOperations     = protectedOperations;

            _vsMonitorSelection.AdviseSelectionEvents(this, out uint selectionCookie);
            _runningDocumentTable.AdviseRunningDocTableEvents(this, out uint runningDocumentTableCookie);

            InitOutputPane();

            _settingsSync = new SettingsSync(vimApplicationSettings, markDisplayUtil, controlCharUtil);
            _settingsSync.SyncFromApplicationSettings();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AdornmentLayer"/> class.
        /// </summary>
        /// <param name="view"></param>
        /// <param name="textSearchService"></param>
        /// <param name="IEditorOperationsFactoryService"></param>
        /// <param name="IEditorFormatMapService"></param>
        /// <param name="ITextStructureNavigator"></param>
        /// <param name="IOutliningManagerService"></param>
        public AdornmentLayer(
            IWpfTextView view,
            ITextSearchService textSearchService,
            IEditorOperationsFactoryService editorOperationsService,
            IEditorFormatMapService formatMapService         = null,
            ITextStructureNavigator textStructureNavigator   = null,
            IOutliningManagerService outliningManagerService = null
            )
        {
            view.Properties.GetOrCreateSingletonProperty(
                typeof(AdornmentLayer), () => this
                );

            this.view  = view;
            this.layer = view.GetAdornmentLayer(Vsix.Name);

            this.Selector = new Selector(
                view,
                textSearchService,
                editorOperationsService,
                formatMapService,
                textStructureNavigator,
                outliningManagerService
                );

            this.SetupBrushes(formatMapService);

            // events
            this.view.LayoutChanged += this.OnLayoutChanged;

            MenuCommandRegistrations.OnConvertSelectionToMultipleCursorsPressed += new CmdConvertSelectionToMultipleCursors(view).OnCommandInvoked;
            MenuCommandRegistrations.OnSelectNextOccurrencePressed          += new CmdSelectNextOccurrence(view).OnCommandInvoked;
            MenuCommandRegistrations.OnSelectNextExactOccurrencePressed     += new CmdSelectNextExactOccurrence(view).OnCommandInvoked;
            MenuCommandRegistrations.OnSelectPreviousExactOccurrencePressed += new CmdSelectPreviousExactOccurrence(view).OnCommandInvoked;
            MenuCommandRegistrations.OnSelectPreviousOccurrencePressed      += new CmdSelectPreviousOccurrence(view).OnCommandInvoked;
            MenuCommandRegistrations.OnSkipOccurrencePressed       += new CmdSkipOccurrence(view).OnCommandInvoked;
            MenuCommandRegistrations.OnUndoOccurrencePressed       += new CmdUndoOccurrence(view).OnCommandInvoked;
            MenuCommandRegistrations.OnAddCaretAbovePressed        += new CmdAddCaretAbove(view).OnCommandInvoked;
            MenuCommandRegistrations.OnAddCaretBelowPressed        += new CmdAddCaretBelow(view).OnCommandInvoked;
            MenuCommandRegistrations.OnSelectAllOccurrencesPressed += new CmdSelectAllOccurrences(view).OnCommandInvoked;
        }
 public InteractiveWindowProvider(
     IContentTypeRegistryService contentTypeRegistry,
     ITextBufferFactoryService bufferFactory,
     IProjectionBufferFactoryService projectionBufferFactory,
     IEditorOperationsFactoryService editorOperationsFactory,
     ITextEditorFactoryService editorFactory,
     IRtfBuilderService rtfBuilderService,
     IIntellisenseSessionStackMapService intellisenseSessionStackMap,
     ISmartIndentationService smartIndenterService,
     IInteractiveWindowEditorFactoryService windowFactoryService)
 {
     _contentTypeRegistry         = contentTypeRegistry;
     _bufferFactory               = bufferFactory;
     _projectionBufferFactory     = projectionBufferFactory;
     _editorOperationsFactory     = editorOperationsFactory;
     _editorFactory               = editorFactory;
     _rtfBuilderService           = rtfBuilderService;
     _intellisenseSessionStackMap = intellisenseSessionStackMap;
     _smartIndenterService        = smartIndenterService;
     _windowFactoryService        = windowFactoryService;
 }
Exemplo n.º 37
0
 internal VimAppHost(
     IProtectedOperations protectedOperations,
     ITextBufferFactoryService textBufferFactoryService,
     ITextEditorFactoryService textEditorFactoryService,
     ITextDocumentFactoryService textDocumentFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IContentTypeRegistryService contentTypeRegistryService,
     IFileSystem fileSystem,
     IDirectoryUtil directoryUtil) :
     base(
         protectedOperations,
         textBufferFactoryService,
         textEditorFactoryService,
         textDocumentFactoryService,
         editorOperationsFactoryService)
 {
     _protectedOperations        = protectedOperations;
     _contentTypeRegistryService = contentTypeRegistryService;
     _fileSystem    = fileSystem;
     _directoryUtil = directoryUtil;
 }
 TextEditorFactoryService(ITextBufferFactoryService textBufferFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, ICommandManager commandManager, ISmartIndentationService smartIndentationService, [ImportMany] IEnumerable <Lazy <IWpfTextViewCreationListener, IDeferrableContentTypeAndTextViewRoleMetadata> > wpfTextViewCreationListeners, IFormattedTextSourceFactoryService formattedTextSourceFactoryService, IViewClassifierAggregatorService viewClassifierAggregatorService, ITextAndAdornmentSequencerFactoryService textAndAdornmentSequencerFactoryService, IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService editorFormatMapService, IAdornmentLayerDefinitionService adornmentLayerDefinitionService, ILineTransformProviderService lineTransformProviderService, IWpfTextViewMarginProviderCollectionProvider wpfTextViewMarginProviderCollectionProvider, IMenuManager menuManager, IEditorOperationsFactoryService editorOperationsFactoryService, ISpaceReservationStackProvider spaceReservationStackProvider, IWpfTextViewConnectionListenerServiceProvider wpfTextViewConnectionListenerServiceProvider, IBufferGraphFactoryService bufferGraphFactoryService)
 {
     this.textBufferFactoryService    = textBufferFactoryService;
     this.editorOptionsFactoryService = editorOptionsFactoryService;
     this.commandManager                              = commandManager;
     this.smartIndentationService                     = smartIndentationService;
     this.wpfTextViewCreationListeners                = wpfTextViewCreationListeners.ToArray();
     this.formattedTextSourceFactoryService           = formattedTextSourceFactoryService;
     this.viewClassifierAggregatorService             = viewClassifierAggregatorService;
     this.textAndAdornmentSequencerFactoryService     = textAndAdornmentSequencerFactoryService;
     this.classificationFormatMapService              = classificationFormatMapService;
     this.editorFormatMapService                      = editorFormatMapService;
     this.adornmentLayerDefinitionService             = adornmentLayerDefinitionService;
     this.lineTransformProviderService                = lineTransformProviderService;
     this.wpfTextViewMarginProviderCollectionProvider = wpfTextViewMarginProviderCollectionProvider;
     this.menuManager = menuManager;
     this.editorOperationsFactoryService = editorOperationsFactoryService;
     this.spaceReservationStackProvider  = spaceReservationStackProvider;
     this.wpfTextViewConnectionListenerServiceProvider = wpfTextViewConnectionListenerServiceProvider;
     this.bufferGraphFactoryService = bufferGraphFactoryService;
 }
 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;
 }
Exemplo n.º 40
0
        public AsyncCompletionService(
            IThreadingContext threadingContext,
            IEditorOperationsFactoryService editorOperationsFactoryService,
            IFeatureServiceFactory featureServiceFactory,
            ITextUndoHistoryRegistry undoHistoryRegistry,
            IInlineRenameService inlineRenameService,
            IAsynchronousOperationListenerProvider listenerProvider,
            [ImportMany] IEnumerable <Lazy <IIntelliSensePresenter <ICompletionPresenterSession, ICompletionSession>, OrderableMetadata> > completionPresenters,
            [ImportMany] IEnumerable <Lazy <IBraceCompletionSessionProvider, BraceCompletionMetadata> > autoBraceCompletionChars)
            : base(threadingContext)
        {
            _editorOperationsFactoryService = editorOperationsFactoryService;
            _featureServiceFactory          = featureServiceFactory;
            _undoHistoryRegistry            = undoHistoryRegistry;
            _inlineRenameService            = inlineRenameService;
            _completionPresenter            = ExtensionOrderer.Order(completionPresenters).Select(lazy => lazy.Value).FirstOrDefault();
            _listener = listenerProvider.GetListener(FeatureAttribute.CompletionSet);

            _autoBraceCompletionChars   = autoBraceCompletionChars;
            _autoBraceCompletionCharSet = new Dictionary <IContentType, ImmutableHashSet <char> >();
        }
Exemplo n.º 41
0
 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();
 }
Exemplo n.º 42
0
        public CoreEditor(IServiceContainer services, string text, string filePath, string contentTypeName)
        {
            _textEditorFactoryService       = services.GetService <ITextEditorFactoryService>();
            _textDocumentFactoryService     = services.GetService <ITextDocumentFactoryService>();
            _textBufferFactoryService       = services.GetService <ITextBufferFactoryService>();
            _classificationFormatMapService = services.GetService <IClassificationFormatMapService>();
            _textBufferUndoManagerProvider  = services.GetService <ITextBufferUndoManagerProvider>();
            _editorOperationsFactoryService = services.GetService <IEditorOperationsFactoryService>();
            _editorOptionsFactoryService    = services.GetService <IEditorOptionsFactoryService>();

            _services = services;
            _filePath = filePath;

            if (string.IsNullOrEmpty(_filePath) || Path.GetExtension(_filePath).Length == 0)
            {
                Check.ArgumentNull(nameof(contentTypeName), contentTypeName);
                var contentTypeRegistryService = services.GetService <IContentTypeRegistryService>();
                _contentType = contentTypeRegistryService.GetContentType(contentTypeName);
            }

            CreateTextViewHost(text, filePath);
        }
Exemplo n.º 43
0
        OutputService(IOutputWindowOptionsService outputWindowOptionsService, IEditorOperationsFactoryService editorOperationsFactoryService, ILogEditorProvider logEditorProvider, OutputServiceSettingsImpl outputServiceSettingsImpl, IPickSaveFilename pickSaveFilename, IMenuService menuService, [ImportMany] IEnumerable <Lazy <IOutputServiceListener, IOutputServiceListenerMetadata> > outputServiceListeners)
        {
            this.outputWindowOptionsService           = outputWindowOptionsService;
            outputWindowOptionsService.OptionChanged += OutputWindowOptionsService_OptionChanged;
            this.editorOperationsFactoryService       = editorOperationsFactoryService;
            this.logEditorProvider         = logEditorProvider;
            this.outputServiceSettingsImpl = outputServiceSettingsImpl;
            this.prevSelectedGuid          = outputServiceSettingsImpl.SelectedGuid;
            this.pickSaveFilename          = pickSaveFilename;
            this.menuService   = menuService;
            this.outputBuffers = new ObservableCollection <OutputBufferVM>();
            this.outputBuffers.CollectionChanged += OutputBuffers_CollectionChanged;

            var listeners = outputServiceListeners.OrderBy(a => a.Metadata.Order).ToArray();

            Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Send, new Action(() => {
                foreach (var lazy in outputServiceListeners)
                {
                    var l = lazy.Value;
                }
            }));
        }
Exemplo n.º 44
0
        public InteractiveWindow(
            IInteractiveWindowEditorFactoryService host,
            IContentTypeRegistryService contentTypeRegistry,
            ITextBufferFactoryService bufferFactory,
            IProjectionBufferFactoryService projectionBufferFactory,
            IEditorOperationsFactoryService editorOperationsFactory,
            ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
            ITextEditorFactoryService editorFactory,
            IRtfBuilderService rtfBuilderService,
            IIntellisenseSessionStackMapService intellisenseSessionStackMap,
            ISmartIndentationService smartIndenterService,
            IInteractiveEvaluator evaluator,
            IWaitIndicator waitIndicator)
        {
            if (evaluator == null)
            {
                throw new ArgumentNullException(nameof(evaluator));
            }

            _uiOnly = new UIThreadOnly(
                this,
                host,
                contentTypeRegistry,
                bufferFactory,
                projectionBufferFactory,
                editorOperationsFactory,
                textBufferUndoManagerProvider,
                editorFactory,
                rtfBuilderService,
                intellisenseSessionStackMap,
                smartIndenterService,
                evaluator,
                waitIndicator);

            evaluator.CurrentWindow = this;

            RequiresUIThread();
        }
Exemplo n.º 45
0
        public RHistory(IRInteractiveWorkflow interactiveWorkflow, ITextBuffer textBuffer, IFileSystem fileSystem, IRSettings settings, IEditorOperationsFactoryService editorOperationsFactory, IRtfBuilderService rtfBuilderService, Action dispose)
        {
            _interactiveWorkflow     = interactiveWorkflow;
            _historyTextBuffer       = textBuffer;
            _fileSystem              = fileSystem;
            _editorOperationsFactory = editorOperationsFactory;
            _rtfBuilderService       = rtfBuilderService;
            _dispose = dispose;

            _textBufferIsEditable = new CountdownDisposable(MakeTextBufferReadOnly);
            _isMultiline          = settings.MultilineHistorySelection;

            if (_isMultiline)
            {
                _entries = new MultilineRHistoryEntries();
            }
            else
            {
                _entries = new SinglelineRHistoryEntries();
            }

            MakeTextBufferReadOnly();
        }
Exemplo n.º 46
0
        public WpfTextViewHost(IWpfTextViewMarginProviderCollectionProvider wpfTextViewMarginProviderCollectionProvider, IDsWpfTextView wpfTextView, IEditorOperationsFactoryService editorOperationsFactoryService, IThemeService themeService, bool setFocus)
        {
            if (wpfTextViewMarginProviderCollectionProvider is null)
            {
                throw new ArgumentNullException(nameof(wpfTextViewMarginProviderCollectionProvider));
            }
            this.editorOperationsFactoryService = editorOperationsFactoryService ?? throw new ArgumentNullException(nameof(editorOperationsFactoryService));
            this.themeService = themeService;
            grid      = CreateGrid();
            TextView  = wpfTextView ?? throw new ArgumentNullException(nameof(wpfTextView));
            Focusable = false;
            Content   = grid;

            themeService.ThemeChanged       += ThemeService_ThemeChanged;
            TextView.BackgroundBrushChanged += TextView_BackgroundBrushChanged;
            UpdateIsInContrastMode();
            UpdateBackground();

            containerMargins    = new IWpfTextViewMargin[5];
            containerMargins[0] = CreateContainerMargin(wpfTextViewMarginProviderCollectionProvider, PredefinedMarginNames.Top, true, 0, 0, 3);
            containerMargins[1] = CreateContainerMargin(wpfTextViewMarginProviderCollectionProvider, PredefinedMarginNames.Bottom, true, 2, 0, 2);
            containerMargins[2] = CreateContainerMargin(wpfTextViewMarginProviderCollectionProvider, PredefinedMarginNames.BottomRightCorner, true, 2, 2, 1);
            containerMargins[3] = CreateContainerMargin(wpfTextViewMarginProviderCollectionProvider, PredefinedMarginNames.Left, false, 1, 0, 1);
            containerMargins[4] = CreateContainerMargin(wpfTextViewMarginProviderCollectionProvider, PredefinedMarginNames.Right, false, 1, 2, 1);
            Add(TextView.VisualElement, 1, 1, 1);
            Debug2.Assert(!containerMargins.Any(a => a is null));

            if (setFocus)
            {
                Dispatcher.BeginInvoke(DispatcherPriority.Render, new Action(() => {
                    if (!TextView.IsClosed)
                    {
                        TextView.VisualElement.Focus();
                    }
                }));
            }
        }
 public BraceCompletionSession(
     ITextView textView,
     ITextBuffer subjectBuffer,
     SnapshotPoint openingPoint,
     char openingBrace,
     char closingBrace,
     ITextUndoHistory undoHistory,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IBraceCompletionService service,
     IThreadingContext threadingContext
     ) : base(threadingContext, assertIsForeground: true)
 {
     this.TextView      = textView;
     this.SubjectBuffer = subjectBuffer;
     this.OpeningBrace  = openingBrace;
     this.ClosingBrace  = closingBrace;
     this.ClosingPoint  = SubjectBuffer.CurrentSnapshot.CreateTrackingPoint(
         openingPoint.Position,
         PointTrackingMode.Positive
         );
     _undoHistory      = undoHistory;
     _editorOperations = editorOperationsFactoryService.GetEditorOperations(textView);
     _service          = service;
 }
Exemplo n.º 48
0
        public DefaultBraceSmartIndenterFactoryFactory(
            JoinableTaskContext joinableTaskContext,
            TextBufferCodeDocumentProvider codeDocumentProvider,
            IEditorOperationsFactoryService editorOperationsFactory)
        {
            if (joinableTaskContext is null)
            {
                throw new ArgumentNullException(nameof(joinableTaskContext));
            }

            if (codeDocumentProvider is null)
            {
                throw new ArgumentNullException(nameof(codeDocumentProvider));
            }

            if (editorOperationsFactory is null)
            {
                throw new ArgumentNullException(nameof(editorOperationsFactory));
            }

            _joinableTaskContext     = joinableTaskContext;
            _codeDocumentProvider    = codeDocumentProvider;
            _editorOperationsFactory = editorOperationsFactory;
        }
        public DefaultBraceSmartIndenterFactoryFactory(
            ForegroundDispatcher foregroundDispatcher,
            TextBufferCodeDocumentProvider codeDocumentProvider,
            IEditorOperationsFactoryService editorOperationsFactory)
        {
            if (foregroundDispatcher == null)
            {
                throw new ArgumentNullException(nameof(foregroundDispatcher));
            }

            if (codeDocumentProvider == null)
            {
                throw new ArgumentNullException(nameof(codeDocumentProvider));
            }

            if (editorOperationsFactory == null)
            {
                throw new ArgumentNullException(nameof(editorOperationsFactory));
            }

            _foregroundDispatcher    = foregroundDispatcher;
            _codeDocumentProvider    = codeDocumentProvider;
            _editorOperationsFactory = editorOperationsFactory;
        }
Exemplo n.º 50
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,
            IExtensionAdapterBroker extensionAdapterBroker,
            SVsServiceProvider serviceProvider,
            ITelemetryProvider telemetryProvider)
            : 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;
            _runningDocumentTable    = serviceProvider.GetService <SVsRunningDocumentTable, IVsRunningDocumentTable>();
            _vsShell                 = (IVsShell)serviceProvider.GetService(typeof(SVsShell));

            _vsMonitorSelection.AdviseSelectionEvents(this, out uint selectionCookie);
            _runningDocumentTable.AdviseRunningDocTableEvents(this, out uint runningDocumentTableCookie);

            InitTelemetry(telemetryProvider.GetOrCreate(vimApplicationSettings, _dte), vimApplicationSettings);
            InitOutputPane(vimApplicationSettings);
        }
Exemplo n.º 51
0
        public MainWindow()
        {
            InitializeComponent();

#if DEBUG
            VimTrace.TraceSwitch.Level = TraceLevel.Info;
#endif

            _vimComponentHost = new VimComponentHost();
            _editorHost       = _vimComponentHost.EditorHost;
            _classificationFormatMapService = _vimComponentHost.CompositionContainer.GetExportedValue <IClassificationFormatMapService>();
            _vimAppOptions    = _vimComponentHost.CompositionContainer.GetExportedValue <IVimAppOptions>();
            _vimWindowManager = _vimComponentHost.CompositionContainer.GetExportedValue <IVimWindowManager>();
            _editorOperationsFactoryService = _vimComponentHost.CompositionContainer.GetExportedValue <IEditorOperationsFactoryService>();
            _textUndoHistoryRegistry        = _vimComponentHost.CompositionContainer.GetExportedValue <ITextUndoHistoryRegistry>();
            var vimAppHost = _vimComponentHost.CompositionContainer.GetExportedValue <VimAppHost>();
            vimAppHost.MainWindow       = this;
            vimAppHost.VimWindowManager = _vimWindowManager;

            _vimWindowManager.VimWindowCreated += OnVimWindowCreated;

            // Create the initial view to display
            AddNewTab("Empty Doc");
        }
Exemplo n.º 52
0
 internal abstract IChainedCommandHandler <AutomaticLineEnderCommandArgs> CreateCommandHandler(
     ITextUndoHistoryRegistry undoRegistry,
     IEditorOperationsFactoryService editorOperations);
 public AutomaticLineEnderCommandHandler(
     ITextUndoHistoryRegistry undoRegistry,
     IEditorOperationsFactoryService editorOperations)
     : base(undoRegistry, editorOperations)
 {
 }
Exemplo n.º 54
0
 public InteractivePasteCommandHandler(IEditorOperationsFactoryService editorOperationsFactoryService, ITextUndoHistoryRegistry textUndoHistoryRegistry)
 {
     _editorOperationsFactoryService = editorOperationsFactoryService;
     _textUndoHistoryRegistry        = textUndoHistoryRegistry;
     RoslynClipboard = new SystemClipboardWrapper();
 }
Exemplo n.º 55
0
 internal ToggleLineCommentCommandHandler(
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IEditorOperationsFactoryService editorOperationsFactoryService)
     : base(undoHistoryRegistry, editorOperationsFactoryService)
 {
 }
 public BlockCommentEditingCommandHandler(
     ITextUndoHistoryRegistry undoHistoryRegistry,
     IEditorOperationsFactoryService editorOperationsFactoryService) : base(undoHistoryRegistry, editorOperationsFactoryService)
 {
 }
Exemplo n.º 57
0
 public ReplEditorOperations(IReplEditor2 replEditor, IWpfTextView wpfTextView, IEditorOperationsFactoryService editorOperationsFactoryService)
 {
     this.replEditor  = replEditor;
     this.wpfTextView = wpfTextView;
     EditorOperations = editorOperationsFactoryService.GetEditorOperations(wpfTextView);
 }
Exemplo n.º 58
0
        /// <summary>
        /// create caret preserving edit transaction with automatic code change undo merging policy
        /// </summary>
        public static CaretPreservingEditTransaction CreateEditTransaction(
            this ITextView view, string description, ITextUndoHistoryRegistry registry, IEditorOperationsFactoryService service)
        {
            var transaction = new CaretPreservingEditTransaction(description, view, registry, service);

            transaction.MergePolicy = AutomaticCodeChangeMergePolicy.Instance;

            return(transaction);
        }
 internal abstract ICommandHandler <AutomaticLineEnderCommandArgs> CreateCommandHandler(
     Microsoft.CodeAnalysis.Editor.Host.IWaitIndicator waitIndicator,
     ITextUndoHistoryRegistry undoRegistry,
     IEditorOperationsFactoryService editorOperations);
Exemplo n.º 60
0
 internal override VSCommanding.ICommandHandler <ReturnKeyCommandArgs> CreateCommandHandler(ITextUndoHistoryRegistry undoHistoryRegistry, IEditorOperationsFactoryService editorOperationsFactoryService)
 => new BlockCommentEditingCommandHandler(undoHistoryRegistry, editorOperationsFactoryService);