コード例 #1
0
 public static ISymbolSearchUpdateEngine CreateEngineInProcess(
     ISymbolSearchLogService logService,
     ISymbolSearchProgressService progressService)
 {
     return(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
         ? new SymbolSearchUpdateEngine(logService, progressService)
         : (ISymbolSearchUpdateEngine) new NoOpUpdateEngine());
 }
コード例 #2
0
 public RemoteUpdateEngine(
     Workspace workspace,
     KeepAliveSession session,
     ISymbolSearchLogService logService,
     ISymbolSearchProgressService progressService)
 {
     _workspace       = workspace;
     _session         = session;
     _logService      = logService;
     _progressService = progressService;
 }
コード例 #3
0
        public static async Task <ISymbolSearchUpdateEngine> CreateEngineAsync(
            Workspace workspace,
            ISymbolSearchLogService logService,
            ISymbolSearchProgressService progressService,
            CancellationToken cancellationToken)
        {
            var client = await RemoteHostClient.TryGetClientAsync(workspace, cancellationToken).ConfigureAwait(false);

            if (client != null)
            {
                var callbackObject = new CallbackObject(logService, progressService);
                var session        = await client.CreateConnectionAsync(WellKnownServiceHubService.RemoteSymbolSearchUpdateEngine, callbackObject, cancellationToken).ConfigureAwait(false);

                return(new RemoteUpdateEngine(workspace, session));
            }

            // Couldn't go out of proc.  Just do everything inside the current process.
            return(CreateEngineInProcess(logService, progressService));
        }
コード例 #4
0
        public static async Task <ISymbolSearchUpdateEngine> CreateEngineAsync(
            Workspace workspace,
            ISymbolSearchLogService logService,
            ISymbolSearchProgressService progressService,
            CancellationToken cancellationToken)
        {
            var client = await workspace.TryGetRemoteHostClientAsync(
                RemoteFeatureOptions.SymbolSearchEnabled, cancellationToken).ConfigureAwait(false);

            if (client != null)
            {
                var session = await client.TryCreateKeepAliveSessionAsync(WellKnownServiceHubServices.RemoteSymbolSearchUpdateEngine, logService, cancellationToken).ConfigureAwait(false);

                if (session != null)
                {
                    return(new RemoteUpdateEngine(workspace, session, logService, progressService));
                }
            }

            // Couldn't go out of proc.  Just do everything inside the current process.
            return(new SymbolSearchUpdateEngine(logService, progressService));
        }