Esempio n. 1
0
        private static VimEditorHost GetOrCreateVimEditorHost()
        {
            if (s_cachedVimEditorHost == null)
            {
                var editorHostFactory = new EditorHostFactory();
                editorHostFactory.Add(new AssemblyCatalog(typeof(IVim).Assembly));

                // Other Exports needed to construct VsVim
                editorHostFactory.Add(new TypeCatalog(
                                          typeof(TestableClipboardDevice),
                                          typeof(TestableKeyboardDevice),
                                          typeof(TestableMouseDevice),
                                          typeof(global::Vim.UnitTest.Exports.VimHost),
                                          typeof(VimErrorDetector),
                                          typeof(DisplayWindowBrokerFactoryService),
                                          typeof(WordCompletionSessionFactoryService),
                                          typeof(AlternateKeyUtil),
                                          typeof(VimProtectedOperations),
                                          typeof(OutlinerTaggerProvider)));

                var compositionContainer = editorHostFactory.CreateCompositionContainer();
                s_cachedVimEditorHost = new VimEditorHost(compositionContainer);
            }

            return(s_cachedVimEditorHost);
        }
Esempio n. 2
0
        private static VimEditorHost GetOrCreateVimEditorHost()
        {
            var key = Thread.CurrentThread.ManagedThreadId;

            if (!s_cachedVimEditorHostMap.TryGetValue(key, out VimEditorHost host))
            {
                var editorHostFactory = new EditorHostFactory();
                editorHostFactory.Add(new AssemblyCatalog(typeof(IVim).Assembly));

                // Other Exports needed to construct VsVim
                editorHostFactory.Add(new TypeCatalog(
                                          typeof(TestableClipboardDevice),
                                          typeof(TestableKeyboardDevice),
                                          typeof(TestableMouseDevice),
                                          typeof(global::Vim.UnitTest.Exports.VimHost),
                                          typeof(VimErrorDetector),
                                          typeof(DisplayWindowBrokerFactoryService),
                                          typeof(WordCompletionSessionFactoryService),
                                          typeof(AlternateKeyUtil),
                                          typeof(OutlinerTaggerProvider)));

                var compositionContainer = editorHostFactory.CreateCompositionContainer();
                host = new VimEditorHost(compositionContainer);
                s_cachedVimEditorHostMap[key] = host;
            }

            return(host);
        }
Esempio n. 3
0
        internal EditorHostLoader()
        {
            var editorHostFactory = new EditorHostFactory();

            editorHostFactory.Add(new AssemblyCatalog(typeof(DefaultKeyProcessorProvider).Assembly));
            editorHostFactory.Add(new AssemblyCatalog(typeof(MarginFactory).Assembly));
            _editorHost = editorHostFactory.CreateEditorHost();
        }
Esempio n. 4
0
        internal VimComponentHost()
        {
            var editorHostFactory = new EditorHostFactory();

            editorHostFactory.Add(new AssemblyCatalog(typeof(IVim).Assembly));
            editorHostFactory.Add(new AssemblyCatalog(typeof(VimKeyProcessor).Assembly));
            editorHostFactory.Add(new AssemblyCatalog(typeof(VimComponentHost).Assembly));
            _editorHost = editorHostFactory.CreateEditorHost();
            _vim = _editorHost.CompositionContainer.GetExportedValue<IVim>();
        }
Esempio n. 5
0
        internal VimComponentHost()
        {
            var editorHostFactory = new EditorHostFactory();

            editorHostFactory.Add(new AssemblyCatalog(typeof(IVim).Assembly));
            editorHostFactory.Add(new AssemblyCatalog(typeof(VimKeyProcessor).Assembly));
            editorHostFactory.Add(new AssemblyCatalog(typeof(VimComponentHost).Assembly));
            _editorHost = editorHostFactory.CreateEditorHost();
            _vim        = _editorHost.CompositionContainer.GetExportedValue <IVim>();
        }
Esempio n. 6
0
        private static VimEditorHost CreateVimEditorHost()
        {
            var editorHostFactory = new EditorHostFactory();

            editorHostFactory.Add(new AssemblyCatalog(typeof(Vim.IVim).Assembly));
            editorHostFactory.Add(new AssemblyCatalog(typeof(Vim.UI.Wpf.VimKeyProcessor).Assembly));
            editorHostFactory.Add(new AssemblyCatalog(typeof(VsCommandTarget).Assembly));
            editorHostFactory.Add(new AssemblyCatalog(typeof(ISharedService).Assembly));
            editorHostFactory.Add(new TypeCatalog(
                                      typeof(Vim.VisualStudio.UnitTest.MemoryLeakTest.ServiceProvider),
                                      typeof(Vim.VisualStudio.UnitTest.MemoryLeakTest.VsEditorAdaptersFactoryService),
                                      typeof(VimErrorDetector)));

            return(new VimEditorHost(editorHostFactory.CreateCompositionContainer()));
        }
Esempio n. 7
0
 private VsfEditorHost GetOrCreateEditorHost()
 {
     if (cachedEditorHost == null)
     {
         var editorHostFactory = new EditorHostFactory();
         var catalog           = new AggregateCatalog(
             new AssemblyCatalog(typeof(LanguageFactory).Assembly),
             new AssemblyCatalog(typeof(PkgSource).Assembly),
             new AssemblyCatalog(typeof(TextBufferBraces).Assembly)
             );
         editorHostFactory.Add(catalog);
         var compositionContainer = editorHostFactory.CreateCompositionContainer();
         cachedEditorHost = new VsfEditorHost(compositionContainer);
     }
     return(cachedEditorHost);
 }
Esempio n. 8
0
 private VsfEditorHost GetOrCreateEditorHost()
 {
     if (cachedEditorHost == null)
     {
         var editorHostFactory = new EditorHostFactory();
         var catalog           = new AggregateCatalog(
             new AssemblyCatalog(typeof(IUpdatableSettings).Assembly), // Viasfora.Settings
             new AssemblyCatalog(typeof(LanguageFactory).Assembly),    // Viasfora.Languages
             new AssemblyCatalog(typeof(Guids).Assembly),              // Viasfora.Core
             new AssemblyCatalog(typeof(TextBufferBraces).Assembly),   // Viasfora.Rainbow
             new AssemblyCatalog(typeof(XmlTaggerProvider).Assembly)   // Viasfora.Xml
             );
         editorHostFactory.Add(catalog);
         var compositionContainer = editorHostFactory.CreateCompositionContainer();
         cachedEditorHost = new VsfEditorHost(compositionContainer);
     }
     return(cachedEditorHost);
 }
Esempio n. 9
0
 private VsfEditorHost GetOrCreateEditorHost()
 {
     if ( cachedEditorHost == null ) {
     var editorHostFactory = new EditorHostFactory();
     var catalog = new AggregateCatalog(
       new AssemblyCatalog(typeof(LanguageFactory).Assembly),
       new AssemblyCatalog(typeof(PkgSource).Assembly),
       new AssemblyCatalog(typeof(TextBufferBraces).Assembly)
       );
     editorHostFactory.Add(catalog);
     var compositionContainer = editorHostFactory.CreateCompositionContainer();
     cachedEditorHost = new VsfEditorHost(compositionContainer);
       }
       return cachedEditorHost;
 }
Esempio n. 10
0
        private static VimEditorHost GetOrCreateVimEditorHost()
        {
            if (s_cachedVimEditorHost == null)
            {
                var editorHostFactory = new EditorHostFactory();
                editorHostFactory.Add(new AssemblyCatalog(typeof(IVim).Assembly));

                // Other Exports needed to construct VsVim
                editorHostFactory.Add(new TypeCatalog(
                    typeof(TestableClipboardDevice),
                    typeof(TestableKeyboardDevice),
                    typeof(TestableMouseDevice),
                    typeof(global::Vim.UnitTest.Exports.VimHost),
                    typeof(VimErrorDetector),
                    typeof(DisplayWindowBrokerFactoryService),
                    typeof(WordCompletionSessionFactoryService),
                    typeof(AlternateKeyUtil),
                    typeof(VimProtectedOperations),
                    typeof(OutlinerTaggerProvider)));

                var compositionContainer = editorHostFactory.CreateCompositionContainer();
                s_cachedVimEditorHost = new VimEditorHost(compositionContainer);
            }

            return s_cachedVimEditorHost;
        }
Esempio n. 11
0
 private VsfEditorHost GetOrCreateEditorHost()
 {
     if ( cachedEditorHost == null ) {
     var editorHostFactory = new EditorHostFactory();
     editorHostFactory.Add(new AssemblyCatalog(typeof(IVsfSettings).Assembly));
     var compositionContainer = editorHostFactory.CreateCompositionContainer();
     cachedEditorHost = new VsfEditorHost(compositionContainer);
       }
       return cachedEditorHost;
 }