Exemplo n.º 1
0
 internal SettingsMigrator(SVsServiceProvider serviceProvider, IVimApplicationSettings vimApplicationSettings, ILegacySettings legacySettings, [EditorUtilsImport] IProtectedOperations protectedOperations)
 {
     _dte = serviceProvider.GetService <SDTE, _DTE>();
     _vimApplicationSettings = vimApplicationSettings;
     _legacySettings         = legacySettings;
     _protectedOperations    = protectedOperations;
 }
Exemplo n.º 2
0
 internal SettingsMigrator(SVsServiceProvider serviceProvider, IVimApplicationSettings vimApplicationSettings, ILegacySettings legacySettings, [EditorUtilsImport] IProtectedOperations protectedOperations)
 {
     _dte = serviceProvider.GetService<SDTE, _DTE>();
     _vimApplicationSettings = vimApplicationSettings;
     _legacySettings = legacySettings;
     _protectedOperations = protectedOperations;
 }
Exemplo n.º 3
0
 internal Provider(IKeyBindingService keyBindingService, IServiceProvider serviceProvider, IVimApplicationSettings vimApplicationSettings, IProtectedOperations protectedOperations)
 {
     _keyBindingService      = keyBindingService;
     _serviceProvider        = serviceProvider;
     _vimApplicationSettings = vimApplicationSettings;
     _protectedOperations    = protectedOperations;
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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
        }
Exemplo n.º 6
0
 internal Provider(IKeyBindingService keyBindingService, IServiceProvider serviceProvider, IVimApplicationSettings vimApplicationSettings, IProtectedOperations protectedOperations)
 {
     _keyBindingService = keyBindingService;
     _serviceProvider = serviceProvider;
     _vimApplicationSettings = vimApplicationSettings;
     _protectedOperations = protectedOperations;
 }
Exemplo n.º 7
0
 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;
 }
Exemplo n.º 8
0
 internal BlockCaretFactoryService(IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService formatMapService, IControlCharUtil controlCharUtil, IVimProtectedOperations protectedOperations)
 {
     _classificationFormatMapService = classificationFormatMapService;
     _formatMapService    = formatMapService;
     _controlCharUtil     = controlCharUtil;
     _protectedOperations = protectedOperations;
 }
Exemplo n.º 9
0
 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;
 }
Exemplo n.º 10
0
 internal OptionsProviderFatory(IKeyBindingService keyBindingService, SVsServiceProvider provider, IVimApplicationSettings vimApplicationSettings, [EditorUtilsImport] IProtectedOperations protectedOperations)
 {
     _keyBindingService      = keyBindingService;
     _serviceProvider        = provider;
     _vimApplicationSettings = vimApplicationSettings;
     _protectedOperations    = protectedOperations;
 }
Exemplo n.º 11
0
        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;
        }
Exemplo n.º 12
0
        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
        }
Exemplo n.º 13
0
 internal BlockCaretFactoryService(IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService formatMapService, IControlCharUtil controlCharUtil, IVimProtectedOperations protectedOperations)
 {
     _classificationFormatMapService = classificationFormatMapService;
     _formatMapService = formatMapService;
     _controlCharUtil = controlCharUtil;
     _protectedOperations = protectedOperations;
 }
Exemplo n.º 14
0
        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
        }
Exemplo n.º 15
0
        /// <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);
            }
        }
Exemplo n.º 16
0
        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;
        }
Exemplo n.º 17
0
        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;
        }
Exemplo n.º 18
0
 internal ExternalEditorManager(
     IVsAdapter vsAdapter,
     [EditorUtilsImport] IProtectedOperations protectedOperations,
     [ImportMany] IEnumerable <IExternalEditAdapter> adapters)
 {
     _vsAdapter           = vsAdapter;
     _protectedOperations = protectedOperations;
     _adapterList         = adapters.ToList();
 }
Exemplo n.º 19
0
 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);
 }
Exemplo n.º 20
0
 internal PasteFactoryService(
     IClassificationFormatMapService classificationFormatMapService,
     IEditorFormatMapService formatMapService,
     IProtectedOperations protectedOperations)
 {
     _classificationFormatMapService = classificationFormatMapService;
     _formatMapService    = formatMapService;
     _protectedOperations = protectedOperations;
 }
Exemplo n.º 21
0
 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);
 }
Exemplo n.º 22
0
 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);
 }
Exemplo n.º 23
0
 internal ExternalEditorManager(
     IVsAdapter vsAdapter,
     IProtectedOperations protectedOperations,
     [ImportMany] IEnumerable<IExternalEditAdapter> adapters)
 {
     _vsAdapter = vsAdapter;
     _protectedOperations = protectedOperations;
     _adapterList = adapters.ToList();
 }
Exemplo n.º 24
0
 internal VimMouseProcessorProvider(
     IVim vim,
     IKeyboardDevice keyboardDevice,
     IProtectedOperations protectedOperations)
 {
     _vim                 = vim;
     _keyboardDevice      = keyboardDevice;
     _protectedOperations = protectedOperations;
 }
Exemplo n.º 25
0
        internal VimApplicationSettings(
            SVsServiceProvider vsServiceProvider,
            ILegacySettings legacySettings,
            [EditorUtilsImport] IProtectedOperations protectedOperations)
            : this(vsServiceProvider.GetVisualStudioVersion(), vsServiceProvider.GetWritableSettingsStore(), protectedOperations)
        {
            var dte = vsServiceProvider.GetService <SDTE, _DTE>();

            MigrateLegacySettings(dte, legacySettings);
        }
Exemplo n.º 26
0
        internal KeyBindingService(_DTE dte, IOptionsDialogService service, IProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings, ScopeData scopeData)
        {
            _dte = dte;
            _optionsDialogService = service;
            _protectedOperations = protectedOperations;
            _vimApplicationSettings = vimApplicationSettings;
            _scopeData = scopeData;

            FixKeyMappingIssue();
        }
Exemplo n.º 27
0
        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;
 }
Exemplo n.º 29
0
 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;
 }
Exemplo n.º 30
0
        internal KeyBindingService(_DTE dte, IKeyboardOptionsProvider keyboardOptionsProvider, IProtectedOperations protectedOperations, IVimApplicationSettings vimApplicationSettings, ScopeData scopeData)
        {
            _dte = dte;
            _keyboardOptionsProvider = keyboardOptionsProvider;
            _protectedOperations     = protectedOperations;
            _vimApplicationSettings  = vimApplicationSettings;
            _scopeData = scopeData;

            FixKeyMappingIssue();
        }
Exemplo n.º 31
0
 internal ExternalEditorManager(
     IVimApplicationSettings vimApplicationSettings,
     IVsAdapter vsAdapter,
     IProtectedOperations protectedOperations,
     [ImportMany] IEnumerable <IExternalEditAdapter> adapters)
 {
     _vimApplicationSettings = vimApplicationSettings;
     _vsAdapter           = vsAdapter;
     _protectedOperations = protectedOperations;
     _adapterList         = adapters.ToList();
 }
Exemplo n.º 32
0
        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));
        }
Exemplo n.º 33
0
 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());
     }
 }
Exemplo n.º 34
0
 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;
 }
Exemplo n.º 35
0
        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;
        }
Exemplo n.º 36
0
        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();
        }
Exemplo n.º 37
0
 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());
     }
 }
Exemplo n.º 38
0
        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();
        }
Exemplo n.º 39
0
        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;
        }
Exemplo n.º 40
0
        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));
        }
Exemplo n.º 41
0
 protected VimHost(
     IProtectedOperations protectedOperations,
     ITextBufferFactoryService textBufferFactoryService,
     ITextEditorFactoryService textEditorFactoryService,
     ITextDocumentFactoryService textDocumentFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService)
 {
     _protectedOperations            = protectedOperations;
     _textBufferFactoryService       = textBufferFactoryService;
     _textEditorFactoryService       = textEditorFactoryService;
     _textDocumentFactoryService     = textDocumentFactoryService;
     _editorOperationsFactoryService = editorOperationsFactoryService;
 }
Exemplo n.º 42
0
 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);
 }
Exemplo n.º 43
0
 internal VimHostImpl(
     IProtectedOperations protectedOperations,
     ITextBufferFactoryService textBufferFactoryService,
     ITextEditorFactoryService textEditorFactoryService,
     ITextDocumentFactoryService textDocumentFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService) :
     base(
         protectedOperations,
         textBufferFactoryService,
         textEditorFactoryService,
         textDocumentFactoryService,
         editorOperationsFactoryService)
 {
 }
Exemplo n.º 44
0
        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;
        }
Exemplo n.º 45
0
        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;
        }
Exemplo n.º 46
0
 internal BlockCaret(
     IWpfTextView textView,
     string adornmentLayerName,
     IClassificationFormatMap classificationFormatMap,
     IEditorFormatMap formatMap,
     IControlCharUtil controlCharUtil,
     IProtectedOperations protectedOperations) :
     this(
         textView,
         classificationFormatMap,
         formatMap,
         textView.GetAdornmentLayer(adornmentLayerName),
         controlCharUtil,
         protectedOperations)
 {
 }
Exemplo n.º 47
0
 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)
 {
 }
Exemplo n.º 48
0
 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;
 }
Exemplo n.º 49
0
        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);
        }
Exemplo n.º 50
0
        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;
            }
        }
Exemplo n.º 51
0
        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);
        }
Exemplo n.º 52
0
        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;
            }
        }
Exemplo n.º 53
0
        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;
        }
Exemplo n.º 54
0
        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;
        }
Exemplo n.º 55
0
 public void SetupBase()
 {
     _vimErrorDetector = EditorUtil.FactoryService.VimErrorDetector;
     _vimErrorDetector.Clear();
     _protectedOperations = new ProtectedOperations(_vimErrorDetector);
 }
Exemplo n.º 56
0
 public void Setup()
 {
     _errorHandler = new Mock<IExtensionErrorHandler>(MockBehavior.Strict);
     _protectedOperationsRaw = new ProtectedOperations(_errorHandler.Object);
     _protectedOperations = _protectedOperationsRaw;
 }
Exemplo n.º 57
0
 internal KeyMappingTimeoutHandler(IProtectedOperations protectedOperations)
 {
     _protectedOperations = protectedOperations;
 }
Exemplo n.º 58
0
        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;
        }
Exemplo n.º 59
0
 internal PasteFactoryService(IEditorFormatMapService formatMapService, IProtectedOperations protectedOperations)
 {
     _formatMapService = formatMapService;
     _protectedOperations = protectedOperations;
 }
Exemplo n.º 60
0
 internal VimApplicationSettings(SVsServiceProvider vsServiceProvider, [EditorUtilsImport] IProtectedOperations protectedOperations)
 {
     var shellSettingsManager = new ShellSettingsManager(vsServiceProvider);
     _settingsStore = shellSettingsManager.GetWritableSettingsStore(SettingsScope.UserSettings);
     _protectedOperations = protectedOperations;
 }