public static UnitTestingIncrementalAnalyzerProvider?TryRegisterAnalyzerProvider(
     string analyzerName,
     IUnitTestingIncrementalAnalyzerProviderImplementation provider
     ) =>
 UnitTestingIncrementalAnalyzerProvider.TryRegister(
     RemoteWorkspaceManager.Default.GetWorkspace(),
     analyzerName,
     provider
     );
Exemplo n.º 2
0
 public UnitTestingIncrementalAnalyzerProvider?TryRegisterAnalyzerProvider(
     string analyzerName,
     IUnitTestingIncrementalAnalyzerProviderImplementation provider
     ) =>
 UnitTestingIncrementalAnalyzerProvider.TryRegister(
     GetWorkspace(),
     analyzerName,
     provider
     );
Exemplo n.º 3
0
        public static async ValueTask <UnitTestingIncrementalAnalyzerProvider?> TryRegisterAnalyzerProviderAsync(
            ServiceBrokerClient client,
            string analyzerName,
            IUnitTestingIncrementalAnalyzerProviderImplementation provider,
            CancellationToken cancellationToken)
        {
            using var rental = await client.GetProxyAsync <IRemoteWorkspaceSolutionProviderService>(RemoteWorkspaceSolutionProviderService.ServiceDescriptor, cancellationToken).ConfigureAwait(false);

            Contract.ThrowIfNull(rental.Proxy);
            var workspace = await rental.Proxy.GetWorkspaceAsync(WorkspaceKind.RemoteWorkspace, cancellationToken).ConfigureAwait(false);

            return(UnitTestingIncrementalAnalyzerProvider.TryRegister(workspace, analyzerName, provider));
        }