Пример #1
0
        public async ValueTask <RemoteDebuggingSessionProxy?> StartDebuggingSessionAsync(
            Solution solution,
            IManagedHotReloadService debuggerService,
            ImmutableArray <DocumentId> captureMatchingDocuments,
            bool captureAllMatchingDocuments,
            bool reportDiagnostics,
            CancellationToken cancellationToken)
        {
            var client = await RemoteHostClient.TryGetClientAsync(Workspace, cancellationToken).ConfigureAwait(false);

            if (client == null)
            {
                var sessionId = await GetLocalService().StartDebuggingSessionAsync(solution, debuggerService, captureMatchingDocuments, captureAllMatchingDocuments, reportDiagnostics, cancellationToken).ConfigureAwait(false);

                return(new RemoteDebuggingSessionProxy(Workspace, LocalConnection.Instance, sessionId));
            }

            // need to keep the providers alive until the edit session ends:
            var connection = client.CreateConnection <IRemoteEditAndContinueService>(
                callbackTarget: new EditSessionCallback(debuggerService));

            var sessionIdOpt = await connection.TryInvokeAsync(
                solution,
                async (service, solutionInfo, callbackId, cancellationToken) => await service.StartDebuggingSessionAsync(solutionInfo, callbackId, captureMatchingDocuments, captureAllMatchingDocuments, reportDiagnostics, cancellationToken).ConfigureAwait(false),
                cancellationToken).ConfigureAwait(false);

            if (sessionIdOpt.HasValue)
            {
                return(new RemoteDebuggingSessionProxy(Workspace, connection, sessionIdOpt.Value));
            }

            connection.Dispose();
            return(null);
        }
Пример #2
0
 public ManagedHotReloadLanguageService(
     VisualStudioWorkspace workspace,
     IManagedHotReloadService hotReloadService,
     IDiagnosticAnalyzerService diagnosticService,
     EditAndContinueDiagnosticUpdateSource diagnosticUpdateSource)
 {
     _proxy                  = new RemoteEditAndContinueServiceProxy(workspace);
     _debuggerService        = new DebuggerService(hotReloadService);
     _diagnosticService      = diagnosticService;
     _diagnosticUpdateSource = diagnosticUpdateSource;
 }
Пример #3
0
 public GlassTestsHotReloadService(HostWorkspaceServices services, IManagedHotReloadService debuggerService)
 {
     _encService      = services.GetRequiredService <IEditAndContinueWorkspaceService>();
     _debuggerService = debuggerService;
 }
Пример #4
0
 public DebuggerService(IManagedHotReloadService hotReloadService)
 {
     _hotReloadService = hotReloadService;
 }
Пример #5
0
 public ManagedHotReloadServiceImpl(IManagedHotReloadService service)
 => _service = service;
Пример #6
0
 public EditSessionCallback(IManagedHotReloadService debuggerService)
 {
     _debuggerService = debuggerService;
 }