internal SettingsMigrator(SVsServiceProvider serviceProvider, IVimApplicationSettings vimApplicationSettings, ILegacySettings legacySettings, [EditorUtilsImport] IProtectedOperations protectedOperations) { _dte = serviceProvider.GetService <SDTE, _DTE>(); _vimApplicationSettings = vimApplicationSettings; _legacySettings = legacySettings; _protectedOperations = protectedOperations; }
internal SettingsMigrator(SVsServiceProvider serviceProvider, IVimApplicationSettings vimApplicationSettings, ILegacySettings legacySettings, [EditorUtilsImport] IProtectedOperations protectedOperations) { _dte = serviceProvider.GetService<SDTE, _DTE>(); _vimApplicationSettings = vimApplicationSettings; _legacySettings = legacySettings; _protectedOperations = protectedOperations; }
internal Provider(IKeyBindingService keyBindingService, IServiceProvider serviceProvider, IVimApplicationSettings vimApplicationSettings, IProtectedOperations protectedOperations) { _keyBindingService = keyBindingService; _serviceProvider = serviceProvider; _vimApplicationSettings = vimApplicationSettings; _protectedOperations = protectedOperations; }
internal BlockCaret( IVimBufferData vimBufferData, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations) { _vimBufferData = vimBufferData; _textView = (IWpfTextView)_vimBufferData.TextView; _selectionUtil = _vimBufferData.SelectionUtil; _editorFormatMap = formatMap; _adornmentLayer = layer; _protectedOperations = protectedOperations; _classificationFormatMap = classificationFormatMap; _controlCharUtil = controlCharUtil; _textView.LayoutChanged += OnCaretEvent; _textView.GotAggregateFocus += OnCaretEvent; _textView.LostAggregateFocus += OnCaretEvent; _textView.Selection.SelectionChanged += OnCaretPositionOrSelectionChanged; _textView.Closed += OnTextViewClosed; _blinkTimer = CreateBlinkTimer(protectedOperations, OnCaretBlinkTimer); }
public HostFactory( IVim vim, ITextBufferFactoryService bufferFactoryService, ITextEditorFactoryService editorFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, IKeyBindingService keyBindingService, SVsServiceProvider serviceProvider, IVsEditorAdaptersFactoryService adaptersFactory, IResharperUtil resharperUtil, IDisplayWindowBrokerFactoryService displayWindowBrokerFactoryService, ITextManager textManager, IVsAdapter adapter, [EditorUtilsImport] IProtectedOperations protectedOperations, IVimBufferCoordinatorFactory bufferCoordinatorFactory, IKeyUtil keyUtil) { _vim = vim; _keyBindingService = keyBindingService; _bufferFactoryService = bufferFactoryService; _editorFactoryService = editorFactoryService; _editorOptionsFactoryService = editorOptionsFactoryService; _resharperUtil = resharperUtil; _displayWindowBrokerFactoryServcie = displayWindowBrokerFactoryService; _adaptersFactory = adaptersFactory; _textManager = textManager; _adapter = adapter; _protectedOperations = protectedOperations; _bufferCoordinatorFactory = bufferCoordinatorFactory; _keyUtil = keyUtil; #if DEBUG VimTrace.TraceSwitch.Level = TraceLevel.Info; #endif }
public HostFactory( IVim vim, ITextBufferFactoryService bufferFactoryService, ITextEditorFactoryService editorFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, IKeyBindingService keyBindingService, SVsServiceProvider serviceProvider, IVsEditorAdaptersFactoryService adaptersFactory, IExternalEditorManager externalEditorManager, IDisplayWindowBrokerFactoryService displayWindowBrokerFactoryService, IVsAdapter adapter, IProtectedOperations protectedOperations, IVimBufferCoordinatorFactory bufferCoordinatorFactory) { _vim = vim; _keyBindingService = keyBindingService; _bufferFactoryService = bufferFactoryService; _editorFactoryService = editorFactoryService; _editorOptionsFactoryService = editorOptionsFactoryService; _externalEditorManager = externalEditorManager; _displayWindowBrokerFactoryServcie = displayWindowBrokerFactoryService; _adaptersFactory = adaptersFactory; _adapter = adapter; _protectedOperations = protectedOperations; _bufferCoordinatorFactory = bufferCoordinatorFactory; }
internal BlockCaretFactoryService(IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService formatMapService, IControlCharUtil controlCharUtil, IVimProtectedOperations protectedOperations) { _classificationFormatMapService = classificationFormatMapService; _formatMapService = formatMapService; _controlCharUtil = controlCharUtil; _protectedOperations = protectedOperations; }
internal OptionsProviderFatory(IKeyBindingService keyBindingService, SVsServiceProvider provider, IVimApplicationSettings vimApplicationSettings, [EditorUtilsImport] IProtectedOperations protectedOperations) { _keyBindingService = keyBindingService; _serviceProvider = provider; _vimApplicationSettings = vimApplicationSettings; _protectedOperations = protectedOperations; }
public HostFactory( IVim vim, ITextBufferFactoryService bufferFactoryService, ITextEditorFactoryService editorFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, IKeyBindingService keyBindingService, SVsServiceProvider serviceProvider, IVsEditorAdaptersFactoryService adaptersFactory, IResharperUtil resharperUtil, IDisplayWindowBrokerFactoryService displayWindowBrokerFactoryService, IVsAdapter adapter, IProtectedOperations protectedOperations, IVimBufferCoordinatorFactory bufferCoordinatorFactory) { _vim = vim; _keyBindingService = keyBindingService; _bufferFactoryService = bufferFactoryService; _editorFactoryService = editorFactoryService; _editorOptionsFactoryService = editorOptionsFactoryService; _resharperUtil = resharperUtil; _displayWindowBrokerFactoryServcie = displayWindowBrokerFactoryService; _adaptersFactory = adaptersFactory; _adapter = adapter; _protectedOperations = protectedOperations; _bufferCoordinatorFactory = bufferCoordinatorFactory; _vim.AutoLoadVimRc = false; }
public HostFactory( IVim vim, IVsEditorAdaptersFactoryService adaptersFactory, IResharperUtil resharperUtil, IDisplayWindowBrokerFactoryService displayWindowBrokerFactoryService, ITextManager textManager, IVsAdapter adapter, [EditorUtilsImport] IProtectedOperations protectedOperations, IVimBufferCoordinatorFactory bufferCoordinatorFactory, IKeyUtil keyUtil, IEditorToSettingsSynchronizer editorToSettingSynchronizer) { _vim = vim; _resharperUtil = resharperUtil; _displayWindowBrokerFactoryServcie = displayWindowBrokerFactoryService; _adaptersFactory = adaptersFactory; _textManager = textManager; _adapter = adapter; _protectedOperations = protectedOperations; _bufferCoordinatorFactory = bufferCoordinatorFactory; _keyUtil = keyUtil; _editorToSettingSynchronizer = editorToSettingSynchronizer; #if DEBUG VimTrace.TraceSwitch.Level = TraceLevel.Info; #endif }
public HostFactory( IVim vim, ITextBufferFactoryService bufferFactoryService, ITextEditorFactoryService editorFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, IKeyBindingService keyBindingService, SVsServiceProvider serviceProvider, IVsEditorAdaptersFactoryService adaptersFactory, IResharperUtil resharperUtil, IDisplayWindowBrokerFactoryService displayWindowBrokerFactoryService, IVsAdapter adapter, [EditorUtilsImport] IProtectedOperations protectedOperations, IVimBufferCoordinatorFactory bufferCoordinatorFactory, IKeyUtil keyUtil) { _vim = vim; _keyBindingService = keyBindingService; _bufferFactoryService = bufferFactoryService; _editorFactoryService = editorFactoryService; _editorOptionsFactoryService = editorOptionsFactoryService; _resharperUtil = resharperUtil; _displayWindowBrokerFactoryServcie = displayWindowBrokerFactoryService; _adaptersFactory = adaptersFactory; _adapter = adapter; _protectedOperations = protectedOperations; _bufferCoordinatorFactory = bufferCoordinatorFactory; _keyUtil = keyUtil; _vim.AutoLoadVimRc = false; #if DEBUG VimTrace.TraceSwitch.Level = TraceLevel.Info; #endif }
/// <summary> /// This helper is used to work around a reported, but unreproducable, bug. The constructor /// of DispatcherTimer is throwing an exception claiming a millisecond time greater /// than int.MaxValue is being passed to the constructor. /// /// This is clearly not possible given the input is an int value. However after multiple user /// reports it's clear the exception is getting triggered. /// /// The only semi-plausible idea I can come up with is a floating point conversion issue. Given /// that the input to Timespan is int and the compared value is double it's possible that a /// conversion / rounding issue is causing int.MaxValue to become int.MaxValue + 1. /// /// Either way though need to guard against this case to unblock users. /// /// https://github.com/jaredpar/VsVim/issues/631 /// https://github.com/jaredpar/VsVim/issues/1860 /// </summary> private static DispatcherTimer CreateBlinkTimer(IProtectedOperations protectedOperations, EventHandler onCaretBlinkTimer) { var caretBlinkTime = GetCaretBlinkTime(); var caretBlinkTimeSpan = new TimeSpan(0, 0, 0, 0, caretBlinkTime ?? int.MaxValue); try { var blinkTimer = new DispatcherTimer( caretBlinkTimeSpan, DispatcherPriority.Normal, protectedOperations.GetProtectedEventHandler(onCaretBlinkTimer), Dispatcher.CurrentDispatcher) { IsEnabled = caretBlinkTime != null }; return(blinkTimer); } catch (ArgumentOutOfRangeException) { // Hit the bug ... just create a simple timer with a default interval. VimTrace.TraceError("Error creating BlockCaret DispatcherTimer"); var blinkTimer = new DispatcherTimer( TimeSpan.FromSeconds(2), DispatcherPriority.Normal, protectedOperations.GetProtectedEventHandler(onCaretBlinkTimer), Dispatcher.CurrentDispatcher) { IsEnabled = true }; return(blinkTimer); } }
internal BlockCaret(ITextView textView, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations) { _textView = textView; _editorFormatMap = formatMap; _adornmentLayer = layer; _protectedOperations = protectedOperations; _classificationFormatMap = classificationFormatMap; _controlCharUtil = controlCharUtil; _textView.LayoutChanged += OnCaretEvent; _textView.GotAggregateFocus += OnCaretEvent; _textView.LostAggregateFocus += OnCaretEvent; _textView.Caret.PositionChanged += OnCaretPositionChanged; _textView.Closed += OnTextViewClosed; var caretBlinkTime = GetCaretBlinkTime(); var caretBlinkTimeSpan = new TimeSpan(0, 0, 0, 0, caretBlinkTime ?? Int32.MaxValue); _blinkTimer = new DispatcherTimer( caretBlinkTimeSpan, DispatcherPriority.Normal, _protectedOperations.GetProtectedEventHandler(OnCaretBlinkTimer), Dispatcher.CurrentDispatcher); _blinkTimer.IsEnabled = caretBlinkTime != null; }
internal ExternalEditorManager( IVsAdapter vsAdapter, [EditorUtilsImport] IProtectedOperations protectedOperations, [ImportMany] IEnumerable <IExternalEditAdapter> adapters) { _vsAdapter = vsAdapter; _protectedOperations = protectedOperations; _adapterList = adapters.ToList(); }
internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, IProtectedOperations protectedOperations, ILegacySettings legacySettings) { _dte = serviceProvider.GetService<SDTE, _DTE>(); _vsShell = serviceProvider.GetService<SVsShell, IVsShell>(); _optionsDialogService = service; _protectedOperations = protectedOperations; _legacySettings = legacySettings; _importantScopeSet = new Lazy<HashSet<string>>(CreateImportantScopeSet); }
internal PasteFactoryService( IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService formatMapService, IProtectedOperations protectedOperations) { _classificationFormatMapService = classificationFormatMapService; _formatMapService = formatMapService; _protectedOperations = protectedOperations; }
internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, [EditorUtilsImport] IProtectedOperations protectedOperations, ILegacySettings legacySettings) { _dte = serviceProvider.GetService <SDTE, _DTE>(); _vsShell = serviceProvider.GetService <SVsShell, IVsShell>(); _optionsDialogService = service; _protectedOperations = protectedOperations; _legacySettings = legacySettings; _importantScopeSet = new Lazy <HashSet <string> >(CreateImportantScopeSet); }
internal KeyBindingService(SVsServiceProvider serviceProvider, IOptionsDialogService service, [EditorUtilsImport] IProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings) { _dte = serviceProvider.GetService<SDTE, _DTE>(); _vsShell = serviceProvider.GetService<SVsShell, IVsShell>(); _optionsDialogService = service; _protectedOperations = protectedOperations; _vimApplicationSettings = vimApplicationSettings; _importantScopeSet = new Lazy<HashSet<string>>(CreateImportantScopeSet); }
internal ExternalEditorManager( IVsAdapter vsAdapter, IProtectedOperations protectedOperations, [ImportMany] IEnumerable<IExternalEditAdapter> adapters) { _vsAdapter = vsAdapter; _protectedOperations = protectedOperations; _adapterList = adapters.ToList(); }
internal VimMouseProcessorProvider( IVim vim, IKeyboardDevice keyboardDevice, IProtectedOperations protectedOperations) { _vim = vim; _keyboardDevice = keyboardDevice; _protectedOperations = protectedOperations; }
internal VimApplicationSettings( SVsServiceProvider vsServiceProvider, ILegacySettings legacySettings, [EditorUtilsImport] IProtectedOperations protectedOperations) : this(vsServiceProvider.GetVisualStudioVersion(), vsServiceProvider.GetWritableSettingsStore(), protectedOperations) { var dte = vsServiceProvider.GetService <SDTE, _DTE>(); MigrateLegacySettings(dte, legacySettings); }
internal KeyBindingService(_DTE dte, IOptionsDialogService service, IProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings, ScopeData scopeData) { _dte = dte; _optionsDialogService = service; _protectedOperations = protectedOperations; _vimApplicationSettings = vimApplicationSettings; _scopeData = scopeData; FixKeyMappingIssue(); }
internal TimerData(IVimBuffer vimBuffer, IVimProtectedOperations protectedOperations, KeyMappingTimeoutHandler keyMappingTimeoutHandler) { _protectedOperations = protectedOperations; _vimBuffer = vimBuffer; _keyMappingTimeoutHandler = keyMappingTimeoutHandler; _timer = new DispatcherTimer(DispatcherPriority.Input); _timer.Tick += OnTimerTick; _vimBuffer.KeyInputProcessed += OnKeyInputProcessed; _vimBuffer.KeyInputBuffered += OnKeyInputBuffered; }
internal TimerData(IVimBuffer vimBuffer, IProtectedOperations protectedOperations, KeyMappingTimeoutHandler keyMappingTimeoutHandler) { _protectedOperations = protectedOperations; _vimBuffer = vimBuffer; _keyMappingTimeoutHandler = keyMappingTimeoutHandler; _timer = new DispatcherTimer(DispatcherPriority.Input); _timer.Tick += OnTimerTick; _vimBuffer.KeyInputProcessed += OnKeyInputProcessed; _vimBuffer.KeyInputBuffered += OnKeyInputBuffered; }
internal KeyBindingService(_DTE dte, IKeyboardOptionsProvider keyboardOptionsProvider, IProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings, ScopeData scopeData) { _dte = dte; _keyboardOptionsProvider = keyboardOptionsProvider; _protectedOperations = protectedOperations; _vimApplicationSettings = vimApplicationSettings; _scopeData = scopeData; FixKeyMappingIssue(); }
internal ExternalEditorManager( IVimApplicationSettings vimApplicationSettings, IVsAdapter vsAdapter, IProtectedOperations protectedOperations, [ImportMany] IEnumerable <IExternalEditAdapter> adapters) { _vimApplicationSettings = vimApplicationSettings; _vsAdapter = vsAdapter; _protectedOperations = protectedOperations; _adapterList = adapters.ToList(); }
public KeyboardSettingsControl(CommandKeyBindingSnapshot snapshot, IVimApplicationSettings vimApplicationSettings, IProtectedOperations protectedOperations) { InitializeComponent(); _snapshot = snapshot; _vimApplicationSettings = vimApplicationSettings; _protectedOperations = protectedOperations; ComputeKeyBindings(); BindingsListBox.ItemsSource = _keyBindingList; BindingsListBox.Items.SortDescriptions.Add(new SortDescription("KeyName", ListSortDirection.Ascending)); }
internal ExternalEditorManager(SVsServiceProvider serviceProvider, IVsAdapter vsAdapter, IProtectedOperations protectedOperations) { _vsAdapter = vsAdapter; _protectedOperations = protectedOperations; _vsShell = serviceProvider.GetService<SVsShell, IVsShell>(); _adapterList.Add(new SnippetExternalEditAdapter()); _isResharperInstalled = CheckResharperInstalled(); if (_isResharperInstalled) { _adapterList.Add(new ResharperExternalEditAdapter()); } }
internal VimCollectionSettingsStore(string collectionPath, WritableSettingsStore writableSettingsStore, IProtectedOperations protectedOperations) { _collectionPath = collectionPath; _protectedOperations = protectedOperations; _settingsStore = writableSettingsStore; _getBoolFunc = writableSettingsStore.GetBoolean; _setBoolFunc = writableSettingsStore.SetBoolean; _getStringFunc = writableSettingsStore.GetString; _setStringFunc = writableSettingsStore.SetString; _getIntFunc = writableSettingsStore.GetInt32; _setIntFunc = writableSettingsStore.SetInt32; }
internal PasteController(IVimBuffer vimBuffer, IWpfTextView wpfTextView, IProtectedOperations protectedOperations, IEditorFormatMap editorFormatMap) { _vimBuffer = vimBuffer; _pasteAdornment = new PasteAdornment( wpfTextView, wpfTextView.GetAdornmentLayer(PasteFactoryService.PasteAdornmentLayerName), protectedOperations, editorFormatMap); _vimBuffer.KeyInputProcessed += OnKeyInputProcessed; _vimBuffer.Closed += OnVimBufferClosed; }
public KeyboardSettingsControl(IVim vim, IKeyBindingService keyBindingService, IVimApplicationSettings vimApplicationSettings, IProtectedOperations protectedOperations) { InitializeComponent(); _vim = vim; _keyBindingService = keyBindingService; _vimApplicationSettings = vimApplicationSettings; _protectedOperations = protectedOperations; IncludeAllScopes = keyBindingService.IncludeAllScopes; BindingsListBox.Items.SortDescriptions.Add(new SortDescription("KeyName", ListSortDirection.Ascending)); ComputeKeyBindings(); }
internal ExternalEditorManager(SVsServiceProvider serviceProvider, IVsAdapter vsAdapter, IProtectedOperations protectedOperations) { _vsAdapter = vsAdapter; _protectedOperations = protectedOperations; _vsShell = serviceProvider.GetService <SVsShell, IVsShell>(); _adapterList.Add(new SnippetExternalEditAdapter()); _isResharperInstalled = CheckResharperInstalled(); if (_isResharperInstalled) { _adapterList.Add(new ResharperExternalEditAdapter()); } }
protected VimHost( IProtectedOperations protectedOperations, ITextBufferFactoryService textBufferFactoryService, ITextEditorFactoryService textEditorFactoryService, ITextDocumentFactoryService textDocumentFactoryService, IEditorOperationsFactoryService editorOperationsFactoryService) { _protectedOperations = protectedOperations; _textBufferFactoryService = textBufferFactoryService; _textEditorFactoryService = textEditorFactoryService; _textDocumentFactoryService = textDocumentFactoryService; _editorOperationsFactoryService = editorOperationsFactoryService; }
protected VimTestBase() { _vim = CompositionContainer.GetExportedValue<IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>(); _wordUtilFactory = CompositionContainer.GetExportedValue<IWordUtilFactory>(); _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>(); _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>(); _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>(); _protectedOperations = new ProtectedOperations(_vimErrorDetector); }
internal VimHostImpl( IProtectedOperations protectedOperations, ITextBufferFactoryService textBufferFactoryService, ITextEditorFactoryService textEditorFactoryService, ITextDocumentFactoryService textDocumentFactoryService, IEditorOperationsFactoryService editorOperationsFactoryService) : base( protectedOperations, textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService) { }
internal PasteAdornment( ITextView textView, IAdornmentLayer adornmentLayer, IProtectedOperations protectedOperations, IEditorFormatMap editorFormatMap) { _textView = textView; _protectedOperations = protectedOperations; _editorFormatMap = editorFormatMap; _adornmentLayer = adornmentLayer; _textView.Caret.PositionChanged += OnChangeEvent; _textView.LayoutChanged += OnChangeEvent; }
internal BlockCaret( IWpfTextView textView, string adornmentLayerName, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations) : this( textView, classificationFormatMap, formatMap, textView.GetAdornmentLayer(adornmentLayerName), controlCharUtil, protectedOperations) { }
internal BlockCaret( IVimBufferData vimBufferData, string adornmentLayerName, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations) : this( vimBufferData, classificationFormatMap, formatMap, (vimBufferData.TextView as IWpfTextView).GetAdornmentLayer(adornmentLayerName), controlCharUtil, protectedOperations) { }
internal EditorFactory( SVsServiceProvider vsServiceProvider, IVsEditorAdaptersFactoryService vsEditorAdaptersAdapterFactory, ITextBufferFactoryService textBufferFactoryService, ITextDocumentFactoryService textDocumentFactoryService, ITextEditorFactoryService textEditorFactoryService, [EditorUtilsImport] IProtectedOperations protectedOperations) { _vsEditorFactory = new VsEditorFactory(); _vsServiceProvider = vsServiceProvider; _vsEditorAdaptersFactoryService = vsEditorAdaptersAdapterFactory; _textBufferFactoryService = textBufferFactoryService; _textDocumentFactoryService = textDocumentFactoryService; _textEditorFactoryService = textEditorFactoryService; _oleServiceProvider = _vsServiceProvider.GetService<IOleServiceProvider, IOleServiceProvider>(); _protectedOperations = protectedOperations; }
internal BlockCaret(ITextView textView, IClassificationFormatMap classificationFormatMap, IEditorFormatMap formatMap, IAdornmentLayer layer, IControlCharUtil controlCharUtil, IProtectedOperations protectedOperations) { _textView = textView; _editorFormatMap = formatMap; _adornmentLayer = layer; _protectedOperations = protectedOperations; _classificationFormatMap = classificationFormatMap; _controlCharUtil = controlCharUtil; _textView.LayoutChanged += OnCaretEvent; _textView.GotAggregateFocus += OnCaretEvent; _textView.LostAggregateFocus += OnCaretEvent; _textView.Caret.PositionChanged += OnCaretPositionChanged; _textView.Closed += OnTextViewClosed; _blinkTimer = CreateBlinkTimer(protectedOperations, OnCaretBlinkTimer); }
internal VimApplicationSettings(VisualStudioVersion visualStudioVersion, WritableSettingsStore settingsStore, IProtectedOperations protectedOperations) { _settingsStore = settingsStore; _protectedOperations = protectedOperations; // Legacy settings were only supported on Visual Studio 2010 and 2012. For any other version there is no // need to modify the legacy settings switch (visualStudioVersion) { case VisualStudioVersion.Vs2010: case VisualStudioVersion.Vs2012: _legacySettingsSupported = true; break; default: // Intentionally do nothing break; } }
internal BlockCaret(ITextView view, IEditorFormatMap formatMap, IAdornmentLayer layer, IProtectedOperations protectedOperations) { _view = view; _formatMap = formatMap; _layer = layer; _protectedOperations = protectedOperations; _view.LayoutChanged += OnCaretEvent; _view.GotAggregateFocus += OnCaretEvent; _view.LostAggregateFocus += OnCaretEvent; _view.Caret.PositionChanged += OnCaretEvent; _view.Closed += OnTextViewClosed; var caretBlinkTime = NativeMethods.GetCaretBlinkTime(); var caretBlinkTimeSpan = new TimeSpan(0, 0, 0, 0, caretBlinkTime); _blinkTimer = new DispatcherTimer( caretBlinkTimeSpan, DispatcherPriority.Normal, _protectedOperations.GetProtectedEventHandler(OnCaretBlinkTimer), Dispatcher.CurrentDispatcher); }
internal ExternalEditMonitor( IVimBuffer buffer, IProtectedOperations protectedOperations, Result<IVsTextLines> vsTextLines, ReadOnlyCollection<ITagger<ITag>> taggerCollection, ReadOnlyCollection<IExternalEditAdapter> externalEditorAdapters) { _vsTextLines = vsTextLines; _protectedOperations = protectedOperations; _externalEditorAdapters = externalEditorAdapters; _taggerCollection = taggerCollection; _buffer = buffer; _buffer.TextView.LayoutChanged += OnLayoutChanged; _buffer.SwitchedMode += OnSwitchedMode; _textView = _buffer.TextView; foreach (var tagger in _taggerCollection) { tagger.TagsChanged += OnTagsChanged; } }
protected VimTestBase() { _vim = CompositionContainer.GetExportedValue<IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>(); _wordUtilFactory = CompositionContainer.GetExportedValue<IWordUtilFactory>(); _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>(); _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>(); _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>(); _protectedOperations = new ProtectedOperations(_vimErrorDetector); _clipboardDevice.Text = String.Empty; // One setting we do differ on for a default is 'timeout'. We don't want them interferring // with the reliability of tests. The default is on but turn it off here to prevent any // problems _vim.GlobalSettings.Timeout = false; // Don't let the personal VimRc of the user interfere with the unit tests _vim.AutoLoadVimRc = false; }
public void SetupBase() { _vimErrorDetector = EditorUtil.FactoryService.VimErrorDetector; _vimErrorDetector.Clear(); _protectedOperations = new ProtectedOperations(_vimErrorDetector); }
public void Setup() { _errorHandler = new Mock<IExtensionErrorHandler>(MockBehavior.Strict); _protectedOperationsRaw = new ProtectedOperations(_errorHandler.Object); _protectedOperations = _protectedOperationsRaw; }
internal KeyMappingTimeoutHandler(IProtectedOperations protectedOperations) { _protectedOperations = protectedOperations; }
public override void SetupBase() { base.SetupBase(); _vim = CompositionContainer.GetExportedValue<IVim>(); _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>(); _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>(); _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>(); _wordUtilFactory = CompositionContainer.GetExportedValue<IWordUtilFactory>(); _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>(); _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>(); _vimErrorDetector.Clear(); _protectedOperations = new ProtectedOperations(_vimErrorDetector); // One setting we do differ on for a default is 'timeout'. We don't want them interferring // with the reliability of tests. The default is on but turn it off here to prevent any // problems _vim.GlobalSettings.Timeout = false; // Don't let the personal VimRc of the user interfere with the unit tests _vim.AutoLoadVimRc = false; _vim.VimData.LastShellCommand = FSharpOption<string>.None; _vim.VimData.LastCommand = FSharpOption<StoredCommand>.None; }
internal PasteFactoryService(IEditorFormatMapService formatMapService, IProtectedOperations protectedOperations) { _formatMapService = formatMapService; _protectedOperations = protectedOperations; }
internal VimApplicationSettings(SVsServiceProvider vsServiceProvider, [EditorUtilsImport] IProtectedOperations protectedOperations) { var shellSettingsManager = new ShellSettingsManager(vsServiceProvider); _settingsStore = shellSettingsManager.GetWritableSettingsStore(SettingsScope.UserSettings); _protectedOperations = protectedOperations; }