public LanguageServer(ChannelBase serverChannel)
            : base(serverChannel, MessageProtocolType.LanguageServer)
        {
            var hostServices = CreateHostServices();

            _exportProvider = hostServices;
            _workspace      = new LanguageServerWorkspace(hostServices);
        }
Exemple #2
0
 public MefWorkspaceServices(IMefHostExportProvider host, Workspace workspace)
 {
     _exportProvider = host;
     _workspace      = workspace;
     _services       = host.GetExports <IWorkspaceService, WorkspaceServiceMetadata>()
                       .Concat(host.GetExports <IWorkspaceServiceFactory, WorkspaceServiceMetadata>()
                               .Select(lz => new Lazy <IWorkspaceService, WorkspaceServiceMetadata>(() => lz.Value.CreateService(this), lz.Metadata)))
                       .ToImmutableArray();
 }
Exemple #3
0
 internal override AbstractPersistentStorageService GetStorageService(
     IMefHostExportProvider exportProvider,
     IPersistentStorageLocationService locationService,
     IPersistentStorageFaultInjector?faultInjector
     ) =>
 new SQLitePersistentStorageService(
     exportProvider.GetExports <SQLiteConnectionPoolService>().Single().Value,
     locationService,
     faultInjector
     );
Exemple #4
0
        internal override AbstractPersistentStorageService GetStorageService(
            OptionSet options, IMefHostExportProvider exportProvider, IPersistentStorageLocationService locationService, IPersistentStorageFaultInjector?faultInjector, string relativePathBase)
        {
            var threadingContext = exportProvider.GetExports <IThreadingContext>().Single().Value;

            return(new MockCloudCachePersistentStorageService(
                       locationService,
                       relativePathBase,
                       cs =>
            {
                if (cs is IAsyncDisposable asyncDisposable)
                {
                    threadingContext.JoinableTaskFactory.Run(
                        () => asyncDisposable.DisposeAsync().AsTask());
                }
                else if (cs is IDisposable disposable)
                {
                    disposable.Dispose();
                }
            }));
        }
Exemple #5
0
 public LanguageServerWorkspace(MefHostServices hostServices, string rootPath)
     : base(hostServices)
 {
     _hostServices = hostServices;
     _rootPath     = rootPath;
 }
Exemple #6
0
 internal abstract AbstractPersistentStorageService GetStorageService(IMefHostExportProvider exportProvider, IPersistentStorageLocationService locationService, IPersistentStorageFaultInjector?faultInjector);
 internal abstract AbstractPersistentStorageService GetStorageService(
     IMefHostExportProvider exportProvider,
     IPersistentStorageConfiguration configuration,
     IPersistentStorageFaultInjector?faultInjector,
     string rootFolder);
 public static IEnumerable <TExtension> GetExportedValues <TExtension>(this IMefHostExportProvider provider)
 => provider.GetExports <TExtension>().Select(l => l.Value);
 public static TExtension GetExportedValue <TExtension>(this IMefHostExportProvider provider)
 => provider.GetExports <TExtension>().Single().Value;
 internal override AbstractPersistentStorageService GetStorageService(IMefHostExportProvider exportProvider, IPersistentStorageConfiguration configuration, IPersistentStorageFaultInjector?faultInjector, string relativePathBase)
 => new SQLitePersistentStorageService(
     exportProvider.GetExports <SQLiteConnectionPoolService>().Single().Value,
     configuration,
     exportProvider.GetExports <IAsynchronousOperationListenerProvider>().Single().Value.GetListener(FeatureAttribute.PersistentStorage),
     faultInjector);
 internal override AbstractPersistentStorageService GetStorageService(IMefHostExportProvider exportProvider, IPersistentStorageLocationService locationService, IPersistentStorageFaultInjector faultInjector)
 => new SQLitePersistentStorageService(locationService, faultInjector);
 public LanguageServerWorkspace(MefHostServices hostServices)
     : base(hostServices)
 {
     _hostServices = hostServices;
 }
Exemple #13
0
 internal abstract AbstractPersistentStorageService GetStorageService(
     OptionSet options, IMefHostExportProvider exportProvider, IPersistentStorageLocationService locationService, IPersistentStorageFaultInjector?faultInjector, string rootFolder);
 internal override AbstractPersistentStorageService GetStorageService(
     IMefHostExportProvider exportProvider, IPersistentStorageConfiguration configuration, IPersistentStorageFaultInjector?faultInjector, string relativePathBase)
 {
     return(new MockCloudCachePersistentStorageService(configuration, relativePathBase));
 }
Exemple #15
0
 internal override AbstractPersistentStorageService GetStorageService(OptionSet options, IMefHostExportProvider exportProvider, IPersistentStorageLocationService locationService, IPersistentStorageFaultInjector?faultInjector, string relativePathBase)
 => new SQLitePersistentStorageService(options, exportProvider.GetExports <SQLiteConnectionPoolService>().Single().Value, locationService, faultInjector);