Exemple #1
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;
        }
Exemple #2
0
        public HostFactory(
            IVim vim,
            IVsEditorAdaptersFactoryService adaptersFactory,
            IReSharperUtil resharperUtil,
            IDisplayWindowBrokerFactoryService displayWindowBrokerFactoryService,
            ITextManager textManager,
            IVsAdapter adapter,
            IVimProtectedOperations 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
        }
Exemple #3
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);
        }
 internal VsKeyProcessorProvider(IVim vim, IVsAdapter adapter, IVimBufferCoordinatorFactory bufferCoordinatorFactory, IKeyUtil keyUtil)
 {
     _vim = vim;
     _adapter = adapter;
     _bufferCoordinatorFactory = bufferCoordinatorFactory;
     _keyUtil = keyUtil;
 }
Exemple #5
0
        internal static Result <VsCommandTarget> Create(
            IVimBufferCoordinator vimBufferCoordinator,
            IVsTextView vsTextView,
            ITextManager textManager,
            IVsAdapter adapter,
            IDisplayWindowBroker broker,
            IKeyUtil keyUtil,
            IVimApplicationSettings vimApplicationSettings,
            ReadOnlyCollection <ICommandTargetFactory> commandTargetFactoryList)
        {
            var vsCommandTarget = new VsCommandTarget(vimBufferCoordinator, textManager, adapter, broker, keyUtil, vimApplicationSettings);

            var hresult = vsTextView.AddCommandFilter(vsCommandTarget, out IOleCommandTarget nextCommandTarget);

            if (ErrorHandler.Failed(hresult))
            {
                return(Result.CreateError(hresult));
            }

            var commandTargets = commandTargetFactoryList
                                 .Select(x => x.CreateCommandTarget(nextCommandTarget, vimBufferCoordinator))
                                 .Where(x => x != null)
                                 .ToReadOnlyCollection();

            vsCommandTarget.CompleteInit(nextCommandTarget, commandTargets);
            return(Result.CreateSuccess(vsCommandTarget));
        }
Exemple #6
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;
 }
Exemple #7
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
        }
Exemple #8
0
 internal VsKeyProcessor(IVsAdapter adapter, IVimBufferCoordinator bufferCoordinator, IKeyUtil keyUtil)
     : base(bufferCoordinator.VimBuffer, keyUtil)
 {
     _adapter = adapter;
     _bufferCoordinator = bufferCoordinator;
     _searchInProgressInfo = new Lazy<PropertyInfo>(FindSearchInProgressPropertyInfo);
 }
Exemple #9
0
 internal VsKeyProcessor(IVsAdapter adapter, IVimBufferCoordinator bufferCoordinator, IKeyUtil keyUtil)
     : base(bufferCoordinator.VimBuffer, keyUtil)
 {
     _adapter              = adapter;
     _bufferCoordinator    = bufferCoordinator;
     _searchInProgressInfo = new Lazy <PropertyInfo>(FindSearchInProgressPropertyInfo);
 }
Exemple #10
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;

            _vsMonitorSelection.AdviseSelectionEvents(this, out uint cookie);

            InitTelemetry(telemetryProvider.GetOrCreate(vimApplicationSettings, _dte), vimApplicationSettings);
        }
Exemple #11
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);
        }
 internal VimRcLoadNotificationMarginProvider(IVim vim, IVimApplicationSettings vimApplicationSettings, IToastNotificationServiceProvider toastNotificationServiceProvider, IVsAdapter vsAdapter)
 {
     _vim = vim;
     _vimApplicationSettings = vimApplicationSettings;
     _toastNotificationServiceProvider = toastNotificationServiceProvider;
     _vsAdapter = vsAdapter;
 }
Exemple #13
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
        }
Exemple #14
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;
        }
Exemple #15
0
 internal VimRcLoadNotificationMarginProvider(IVim vim, IVimApplicationSettings vimApplicationSettings, IToastNotificationServiceProvider toastNotificationServiceProvider, IVsAdapter vsAdapter)
 {
     _vim = vim;
     _vimApplicationSettings           = vimApplicationSettings;
     _toastNotificationServiceProvider = toastNotificationServiceProvider;
     _vsAdapter = vsAdapter;
 }
 internal VsKeyProcessorProvider(IVim vim, IVsAdapter adapter, IVimBufferCoordinatorFactory bufferCoordinatorFactory, IKeyUtil keyUtil)
 {
     _vim     = vim;
     _adapter = adapter;
     _bufferCoordinatorFactory = bufferCoordinatorFactory;
     _keyUtil = keyUtil;
 }
Exemple #17
0
        public HostFactory(
            IVim vim,
            IVsEditorAdaptersFactoryService adaptersFactory,
            IDisplayWindowBrokerFactoryService displayWindowBrokerFactoryService,
            ITextManager textManager,
            IVsAdapter adapter,
            IVimProtectedOperations protectedOperations,
            IVimBufferCoordinatorFactory bufferCoordinatorFactory,
            IKeyUtil keyUtil,
            IEditorToSettingsSynchronizer editorToSettingSynchronizer,
            [ImportMany] IEnumerable<Lazy<ICommandTargetFactory, IOrderable>> commandTargetFactoryList)
        {
            _vim = vim;
            _displayWindowBrokerFactoryServcie = displayWindowBrokerFactoryService;
            _adaptersFactory = adaptersFactory;
            _textManager = textManager;
            _adapter = adapter;
            _protectedOperations = protectedOperations;
            _bufferCoordinatorFactory = bufferCoordinatorFactory;
            _keyUtil = keyUtil;
            _editorToSettingSynchronizer = editorToSettingSynchronizer;
            _commandTargetFactoryList = Orderer.Order(commandTargetFactoryList).Select(x => x.Value).ToReadOnlyCollection();

            #if DEBUG
            VimTrace.TraceSwitch.Level = TraceLevel.Info;
            #endif
        }
Exemple #18
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
        }
Exemple #19
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;
 }
Exemple #20
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);
        }
Exemple #21
0
        public HostFactory(
            IVim vim,
            IVsEditorAdaptersFactoryService adaptersFactory,
            IDisplayWindowBrokerFactoryService displayWindowBrokerFactoryService,
            ITextManager textManager,
            IVsAdapter adapter,
            IVimProtectedOperations protectedOperations,
            IVimBufferCoordinatorFactory bufferCoordinatorFactory,
            IKeyUtil keyUtil,
            IEditorToSettingsSynchronizer editorToSettingSynchronizer,
            [ImportMany] IEnumerable <Lazy <ICommandTargetFactory, IOrderable> > commandTargetFactoryList)
        {
            _vim = vim;
            _displayWindowBrokerFactoryServcie = displayWindowBrokerFactoryService;
            _adaptersFactory             = adaptersFactory;
            _textManager                 = textManager;
            _adapter                     = adapter;
            _protectedOperations         = protectedOperations;
            _bufferCoordinatorFactory    = bufferCoordinatorFactory;
            _keyUtil                     = keyUtil;
            _editorToSettingSynchronizer = editorToSettingSynchronizer;
            _commandTargetFactoryList    = Orderer.Order(commandTargetFactoryList).Select(x => x.Value).ToReadOnlyCollection();

#if DEBUG
            VimTrace.TraceSwitch.Level = TraceLevel.Info;
#endif
        }
 internal VsVimKeyProcessorProvider(IVim vim, IVsAdapter adapter, IVimBufferCoordinatorFactory bufferCoordinatorFactory, IKeyUtil keyUtil, IReportDesignerUtil reportDesignerUtil)
 {
     _vim     = vim;
     _adapter = adapter;
     _bufferCoordinatorFactory = bufferCoordinatorFactory;
     _keyUtil            = keyUtil;
     _reportDesignerUtil = reportDesignerUtil;
 }
 internal VsVimKeyProcessorProvider(IVim vim, IVsAdapter adapter, IVimBufferCoordinatorFactory bufferCoordinatorFactory, IKeyUtil keyUtil, IReportDesignerUtil reportDesignerUtil)
 {
     _vim = vim;
     _adapter = adapter;
     _bufferCoordinatorFactory = bufferCoordinatorFactory;
     _keyUtil = keyUtil;
     _reportDesignerUtil = reportDesignerUtil;
 }
Exemple #24
0
 internal TextManager(
     IVsAdapter adapter,
     ITextDocumentFactoryService textDocumentFactoryService,
     ITextBufferFactoryService textBufferFactoryService,
     ISharedServiceFactory sharedServiceFactory,
     SVsServiceProvider serviceProvider) : this(adapter, textDocumentFactoryService, textBufferFactoryService, sharedServiceFactory.Create(), serviceProvider)
 {
 }
Exemple #25
0
 internal VsKeyProcessor(IVsAdapter adapter, IVimBufferCoordinator bufferCoordinator, IKeyUtil keyUtil, IReportDesignerUtil reportDesignerUtil, IWpfTextView wpfTextView)
     : base(bufferCoordinator.VimBuffer, keyUtil, wpfTextView)
 {
     _adapter = adapter;
     _reportDesignerUtil = reportDesignerUtil;
     _bufferCoordinator = bufferCoordinator;
     _searchInProgressInfo = new Lazy<PropertyInfo>(FindSearchInProgressPropertyInfo);
 }
Exemple #26
0
 internal VsKeyProcessor(IVsAdapter adapter, IVimBufferCoordinator bufferCoordinator, IKeyUtil keyUtil, IReportDesignerUtil reportDesignerUtil, IWpfTextView wpfTextView)
     : base(bufferCoordinator.VimBuffer, keyUtil, wpfTextView)
 {
     _adapter              = adapter;
     _reportDesignerUtil   = reportDesignerUtil;
     _bufferCoordinator    = bufferCoordinator;
     _searchInProgressInfo = new Lazy <PropertyInfo>(FindSearchInProgressPropertyInfo);
 }
Exemple #27
0
 internal TextManager(
     IVsAdapter adapter,
     ITextDocumentFactoryService textDocumentFactoryService,
     ITextBufferFactoryService textBufferFactoryService,
     ISharedServiceFactory sharedServiceFactory,
     SVsServiceProvider serviceProvider) : this(adapter, textDocumentFactoryService, textBufferFactoryService, sharedServiceFactory.Create(), serviceProvider)
 {
 }
Exemple #28
0
 internal ExternalEditorManager(
     IVsAdapter vsAdapter,
     IProtectedOperations protectedOperations,
     [ImportMany] IEnumerable<IExternalEditAdapter> adapters)
 {
     _vsAdapter = vsAdapter;
     _protectedOperations = protectedOperations;
     _adapterList = adapters.ToList();
 }
Exemple #29
0
 private VsCommandTarget(
     IVimBuffer buffer,
     IVsAdapter adapter,
     IExternalEditorManager externalEditorManager)
 {
     _buffer = buffer;
     _adapter = adapter;
     _externalEditManager = externalEditorManager;
 }
Exemple #30
0
 internal TextManager(
     IVsAdapter adapter,
     SVsServiceProvider serviceProvider)
 {
     _adapter = adapter;
     _serviceProvider = serviceProvider;
     _textManager = _serviceProvider.GetService<SVsTextManager, IVsTextManager>();
     _table = new RunningDocumentTable(_serviceProvider);
 }
 internal ExternalEditorManager(
     IVsAdapter vsAdapter,
     IVimProtectedOperations protectedOperations,
     [ImportMany] IEnumerable <IExternalEditAdapter> adapters)
 {
     _vsAdapter           = vsAdapter;
     _protectedOperations = protectedOperations;
     _adapterList         = adapters.ToList();
 }
Exemple #32
0
        protected override void Initialize()
        {
            base.Initialize();

            _componentModel = (IComponentModel)GetService(typeof(SComponentModel));
            _exportProvider = _componentModel.DefaultExportProvider;
            _vim            = _exportProvider.GetExportedValue <IVim>();
            _vsAdapter      = _exportProvider.GetExportedValue <IVsAdapter>();
        }
Exemple #33
0
 internal TextManager(
     IVsAdapter adapter,
     SVsServiceProvider serviceProvider)
 {
     _adapter         = adapter;
     _serviceProvider = serviceProvider;
     _textManager     = _serviceProvider.GetService <SVsTextManager, IVsTextManager>();
     _table           = new RunningDocumentTable(_serviceProvider);
 }
        internal FallbackKeyProcessorProvider(SVsServiceProvider serviceProvider, IKeyUtil keyUtil, IVimApplicationSettings vimApplicationSettings, IVim vim, IVsAdapter vsAdapter)
        {
            _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _keyUtil = keyUtil;
            _vimApplicationSettings = vimApplicationSettings;
            _vim = vim;
            _vsAdapter = vsAdapter;

            _vsShell = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            _scopeData = new ScopeData(_vsShell);
        }
Exemple #35
0
        internal FallbackKeyProcessorProvider(SVsServiceProvider serviceProvider, IKeyUtil keyUtil, IVimApplicationSettings vimApplicationSettings, IVim vim, IVsAdapter vsAdapter)
        {
            _dte     = (_DTE)serviceProvider.GetService(typeof(_DTE));
            _keyUtil = keyUtil;
            _vimApplicationSettings = vimApplicationSettings;
            _vim       = vim;
            _vsAdapter = vsAdapter;

            _vsShell   = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            _scopeData = new ScopeData(_vsShell);
        }
Exemple #36
0
 private VsCommandTarget(
     IVimBuffer buffer,
     IVsAdapter adapter,
     IDisplayWindowBroker broker,
     IExternalEditorManager externalEditorManager)
 {
     _buffer              = buffer;
     _adapter             = adapter;
     _broker              = broker;
     _externalEditManager = externalEditorManager;
 }
 internal ExternalEditorManager(SVsServiceProvider serviceProvider, IVsAdapter vsAdapter)
 {
     _vsAdapter = vsAdapter;
     _vsShell = serviceProvider.GetService<SVsShell, IVsShell>();
     _adapterList.Add(new SnippetExternalEditAdapter());
     _isResharperInstalled = CheckResharperInstalled();
     if (_isResharperInstalled)
     {
         _adapterList.Add(new ResharperExternalEditAdapter());
     }
 }
Exemple #38
0
 internal ExternalEditorManager(
     IVimApplicationSettings vimApplicationSettings,
     IVsAdapter vsAdapter, 
     IVimProtectedOperations protectedOperations,
     [ImportMany] IEnumerable<IExternalEditAdapter> adapters)
 {
     _vimApplicationSettings = vimApplicationSettings;
     _vsAdapter = vsAdapter;
     _protectedOperations = protectedOperations;
     _adapterList = adapters.ToList();
 }
Exemple #39
0
        internal static Result <VsCommandTarget> Create(
            IVimBufferCoordinator bufferCoordinator,
            IVsTextView vsTextView,
            IVsAdapter adapter,
            IDisplayWindowBroker broker,
            IExternalEditorManager externalEditorManager)
        {
            var filter  = new VsCommandTarget(bufferCoordinator, adapter, broker, externalEditorManager);
            var hresult = vsTextView.AddCommandFilter(filter, out filter._nextTarget);

            return(Result.CreateSuccessOrError(filter, hresult));
        }
Exemple #40
0
 internal VsCommandTarget(
     IVimBufferCoordinator vimBufferCoordinator,
     ITextManager textManager,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IKeyUtil keyUtil,
     IOleCommandTarget nextTarget,
     ReadOnlyCollection<ICommandTarget> commandTargets)
     : this(vimBufferCoordinator, textManager, vsAdapter, broker, keyUtil)
 {
     CompleteInit(nextTarget, commandTargets);
 }
Exemple #41
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());
     }
 }
Exemple #42
0
 internal VsCommandTarget(
     IVimBufferCoordinator vimBufferCoordinator,
     ITextManager textManager,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IKeyUtil keyUtil,
     IOleCommandTarget nextTarget,
     ReadOnlyCollection <ICommandTarget> commandTargets)
     : this(vimBufferCoordinator, textManager, vsAdapter, broker, keyUtil)
 {
     CompleteInit(nextTarget, commandTargets);
 }
Exemple #43
0
 internal TextManager(
     IVsAdapter adapter,
     ITextDocumentFactoryService textDocumentFactoryService,
     ITextBufferFactoryService textBufferFactoryService,
     SVsServiceProvider serviceProvider)
 {
     _vsAdapter = adapter;
     _serviceProvider = serviceProvider;
     _textManager = _serviceProvider.GetService<SVsTextManager, IVsTextManager>();
     _textDocumentFactoryService = textDocumentFactoryService;
     _textBufferFactoryService = textBufferFactoryService;
     _table = new RunningDocumentTable(_serviceProvider);
 }
Exemple #44
0
 private VsCommandTarget(
     IVimBufferCoordinator bufferCoordinator,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IExternalEditorManager externalEditorManager)
 {
     _buffer              = bufferCoordinator.VimBuffer;
     _bufferCoordinator   = bufferCoordinator;
     _textBuffer          = _buffer.TextBuffer;
     _vsAdapter           = vsAdapter;
     _broker              = broker;
     _externalEditManager = externalEditorManager;
 }
Exemple #45
0
        internal VsFilterKeysAdapter(
            IVsFilterKeys filterKeys,
            IVsCodeWindow codeWindow,
            IVsAdapter vsAdapter,
            IVimBuffer buffer)
        {
            _filterKeys = filterKeys;
            _buffer     = buffer;
            _vsAdapter  = vsAdapter;
            _codeWindow = codeWindow;

            _buffer.Closed += delegate { Uninstall(); };
        }
Exemple #46
0
 private VsCommandTarget(
     IVimBufferCoordinator bufferCoordinator,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IExternalEditorManager externalEditorManager)
 {
     _buffer = bufferCoordinator.VimBuffer;
     _bufferCoordinator = bufferCoordinator;
     _textBuffer = _buffer.TextBuffer;
     _vsAdapter = vsAdapter;
     _broker = broker;
     _externalEditManager = externalEditorManager;
 }
Exemple #47
0
 internal TextManager(
     IVsAdapter adapter,
     ITextDocumentFactoryService textDocumentFactoryService,
     ITextBufferFactoryService textBufferFactoryService,
     SVsServiceProvider serviceProvider)
 {
     _vsAdapter                  = adapter;
     _serviceProvider            = serviceProvider;
     _textManager                = _serviceProvider.GetService <SVsTextManager, IVsTextManager>();
     _textDocumentFactoryService = textDocumentFactoryService;
     _textBufferFactoryService   = textBufferFactoryService;
     _table = new RunningDocumentTable(_serviceProvider);
 }
Exemple #48
0
        internal VsFilterKeysAdapter(
            IVsFilterKeys filterKeys,
            IVsCodeWindow codeWindow,
            IVsAdapter vsAdapter,
            IVimBuffer buffer)
        {
            _filterKeys = filterKeys;
            _buffer = buffer;
            _vsAdapter = vsAdapter;
            _codeWindow = codeWindow;

            _buffer.Closed += delegate { Uninstall(); };
        }
Exemple #49
0
 private VsCommandTarget(
     IVimBufferCoordinator bufferCoordinator,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IResharperUtil resharperUtil)
 {
     _vimBuffer         = bufferCoordinator.VimBuffer;
     _vim               = _vimBuffer.Vim;
     _bufferCoordinator = bufferCoordinator;
     _textBuffer        = _vimBuffer.TextBuffer;
     _vsAdapter         = vsAdapter;
     _broker            = broker;
     _resharperUtil     = resharperUtil;
 }
Exemple #50
0
 private VsCommandTarget(
     IVimBufferCoordinator bufferCoordinator,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IResharperUtil resharperUtil)
 {
     _vimBuffer = bufferCoordinator.VimBuffer;
     _vim = _vimBuffer.Vim;
     _bufferCoordinator = bufferCoordinator;
     _textBuffer = _vimBuffer.TextBuffer;
     _vsAdapter = vsAdapter;
     _broker = broker;
     _resharperUtil = resharperUtil;
 }
Exemple #51
0
 internal VsVimHost(
     IVsAdapter adapter,
     ITextBufferUndoManagerProvider undoManagerProvider,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     ITextManager textManager,
     ITextDocumentFactoryService textDocumentFactoryService,
     SVsServiceProvider serviceProvider)
     : base(textDocumentFactoryService)
 {
     _adapter = adapter;
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
     _textManager = textManager;
 }
Exemple #52
0
        /// <summary>
        /// Try and install the IVsFilterKeys adapter for the given ITextView.
        /// </summary>
        internal static bool TryInstallFilterKeysAdapter(
            IVsAdapter adapter,
            IEditorOptionsFactoryService optionsFactory,
            IVimBuffer buffer)
        {
            var textView = buffer.TextView;

            if (textView.Properties.ContainsProperty(s_key))
            {
                return(true);
            }

            var textLines = adapter.EditorAdapter.GetBufferAdapter(buffer.TextBuffer) as IVsTextLines;

            if (textLines == null)
            {
                return(false);
            }

            IVsCodeWindow codeWindow;

            if (!adapter.GetCodeWindow(textView).TryGetValue(out codeWindow))
            {
                return(false);
            }

            // Grab the field we need to replace.  Be wary that Venus uses a different implementation
            // and the field will not be available
            var type  = codeWindow.GetType();
            var flags = System.Reflection.BindingFlags.Instance
                        | System.Reflection.BindingFlags.NonPublic;
            var field = type.GetField(FieldName, flags);

            if (field == null)
            {
                return(false);
            }

            var oldValue = field.GetValue(codeWindow) as IVsFilterKeys;

            if (oldValue == null)
            {
                return(false);
            }

            var filterKeysAdapter = new VsFilterKeysAdapter(oldValue, codeWindow, adapter, buffer);

            field.SetValue(codeWindow, filterKeysAdapter);
            return(true);
        }
Exemple #53
0
 internal VsVimHost(
     IVsAdapter adapter,
     ITextBufferUndoManagerProvider undoManagerProvider,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     ITextManager textManager,
     ITextDocumentFactoryService textDocumentFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     SVsServiceProvider serviceProvider)
     : base(textDocumentFactoryService, editorOperationsFactoryService)
 {
     _adapter = adapter;
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _dte         = (_DTE)serviceProvider.GetService(typeof(_DTE));
     _textManager = textManager;
 }
Exemple #54
0
 private VsCommandTarget(
     IVimBufferCoordinator vimBufferCoordinator,
     ITextManager textManager,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IKeyUtil keyUtil)
 {
     _vimBuffer            = vimBufferCoordinator.VimBuffer;
     _vim                  = _vimBuffer.Vim;
     _vimBufferCoordinator = vimBufferCoordinator;
     _textBuffer           = _vimBuffer.TextBuffer;
     _vsAdapter            = vsAdapter;
     _broker               = broker;
     _keyUtil              = keyUtil;
 }
Exemple #55
0
 internal TextManager(
     IVsAdapter adapter,
     ITextDocumentFactoryService textDocumentFactoryService,
     ITextBufferFactoryService textBufferFactoryService,
     ISharedService sharedService,
     SVsServiceProvider serviceProvider)
 {
     _vsAdapter                  = adapter;
     _serviceProvider            = serviceProvider;
     _textManager                = _serviceProvider.GetService <SVsTextManager, IVsTextManager>();
     _textDocumentFactoryService = textDocumentFactoryService;
     _textBufferFactoryService   = textBufferFactoryService;
     _runningDocumentTable       = _serviceProvider.GetService <SVsRunningDocumentTable, IVsRunningDocumentTable>();
     _sharedService              = sharedService;
 }
Exemple #56
0
 private VsCommandTarget(
     IVimBufferCoordinator vimBufferCoordinator,
     ITextManager textManager,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IKeyUtil keyUtil)
 {
     _vimBuffer = vimBufferCoordinator.VimBuffer;
     _vim = _vimBuffer.Vim;
     _vimBufferCoordinator = vimBufferCoordinator;
     _textBuffer = _vimBuffer.TextBuffer;
     _vsAdapter = vsAdapter;
     _broker = broker;
     _keyUtil = keyUtil;
 }
Exemple #57
0
 internal TextManager(
     IVsAdapter adapter,
     ITextDocumentFactoryService textDocumentFactoryService,
     ITextBufferFactoryService textBufferFactoryService,
     ISharedService sharedService,
     SVsServiceProvider serviceProvider)
 {
     _vsAdapter = adapter;
     _serviceProvider = serviceProvider;
     _textManager = _serviceProvider.GetService<SVsTextManager, IVsTextManager>();
     _textDocumentFactoryService = textDocumentFactoryService;
     _textBufferFactoryService = textBufferFactoryService;
     _runningDocumentTable = _serviceProvider.GetService<SVsRunningDocumentTable, IVsRunningDocumentTable>();
     _sharedService = sharedService;
 }
Exemple #58
0
 public VsAdapterTest()
 {
     _factory = new MockRepository(MockBehavior.Loose);
     _editorAdapterFactory = _factory.Create<IVsEditorAdaptersFactoryService>();
     _editorOptionsFactory = _factory.Create<IEditorOptionsFactoryService>();
     _incrementalSearchFactoryService = _factory.Create<IIncrementalSearchFactoryService>();
     _serviceProvider = _factory.Create<SVsServiceProvider>();
     _serviceProvider.MakeService<SVsTextManager, IVsTextManager>(_factory);
     _serviceProvider.MakeService<SVsUIShell, IVsUIShell>(_factory);
     _serviceProvider.MakeService<SVsRunningDocumentTable, IVsRunningDocumentTable>(_factory);
     _adapterRaw = new VsAdapter(
         _editorAdapterFactory.Object,
         _editorOptionsFactory.Object,
         _incrementalSearchFactoryService.Object,
         _serviceProvider.Object);
     _adapter = _adapterRaw;
 }
 private VsCommandTarget(
     IVimBufferCoordinator bufferCoordinator,
     ITextManager textManager,
     IVsAdapter vsAdapter,
     IDisplayWindowBroker broker,
     IReSharperUtil resharperUtil,
     IKeyUtil keyUtil)
 {
     _vimBuffer = bufferCoordinator.VimBuffer;
     _vim = _vimBuffer.Vim;
     _bufferCoordinator = bufferCoordinator;
     _textBuffer = _vimBuffer.TextBuffer;
     _textView = _vimBuffer.TextView;
     _textManager = textManager;
     _vsAdapter = vsAdapter;
     _broker = broker;
     _resharperUtil = resharperUtil;
     _keyUtil = keyUtil;
 }
Exemple #60
0
 internal VsVimHost(
     IVsAdapter adapter,
     ITextBufferFactoryService textBufferFactoryService,
     ITextEditorFactoryService textEditorFactoryService,
     ITextDocumentFactoryService textDocumentFactoryService,
     ITextBufferUndoManagerProvider undoManagerProvider,
     IVsEditorAdaptersFactoryService editorAdaptersFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IWordUtilFactory wordUtilFactory,
     ITextManager textManager,
     SVsServiceProvider serviceProvider)
     : base(textBufferFactoryService, textEditorFactoryService, textDocumentFactoryService, editorOperationsFactoryService)
 {
     _vsAdapter = adapter;
     _editorAdaptersFactoryService = editorAdaptersFactoryService;
     _wordUtilFactory = wordUtilFactory;
     _dte = (_DTE)serviceProvider.GetService(typeof(_DTE));
     _textManager = textManager;
 }