public void TestRemoteHostCreation() { var remoteLogger = new TraceSource("inprocRemoteClient"); var testData = new RemoteHostTestData(new RemoteWorkspaceManager(new SolutionAssetCache()), isInProc: true); var streams = FullDuplexStream.CreatePair(); using var _ = new RemoteHostService(streams.Item1, new InProcRemoteHostClient.ServiceProvider(remoteLogger, testData)); }
public InProcRemoteServices(RemoteHostTestData testData) { var remoteLogger = new TraceSource("inprocRemoteClient"); _serviceProvider = new ServiceProvider(remoteLogger, testData); _creatorMap = new Dictionary <RemoteServiceName, Func <Stream, IServiceProvider, ServiceBase> >(); RegisterService(WellKnownServiceHubService.RemoteHost, (s, p) => new RemoteHostService(s, p)); RegisterService(WellKnownServiceHubService.CodeAnalysis, (s, p) => new CodeAnalysisService(s, p)); RegisterService(WellKnownServiceHubService.RemoteSymbolSearchUpdateEngine, (s, p) => new RemoteSymbolSearchUpdateEngine(s, p)); RegisterService(WellKnownServiceHubService.RemoteDesignerAttributeService, (s, p) => new RemoteDesignerAttributeService(s, p)); RegisterService(WellKnownServiceHubService.RemoteProjectTelemetryService, (s, p) => new RemoteProjectTelemetryService(s, p)); RegisterService(WellKnownServiceHubService.RemoteTodoCommentsService, (s, p) => new RemoteTodoCommentsService(s, p)); RegisterService(WellKnownServiceHubService.LanguageServer, (s, p) => new LanguageServer(s, p)); }
public static async Task <RemoteHostClient> CreateAsync( HostWorkspaceServices services, RemoteServiceCallbackDispatcherRegistry callbackDispatchers, TraceListener?traceListener, RemoteHostTestData testData ) { var inprocServices = new InProcRemoteServices(services, traceListener, testData); var remoteHostStream = await inprocServices .RequestServiceAsync(WellKnownServiceHubService.RemoteHost) .ConfigureAwait(false); var instance = new InProcRemoteHostClient( services, inprocServices, callbackDispatchers, remoteHostStream ); // make sure connection is done right var uiCultureLCIDE = 0; var cultureLCID = 0; await instance._endPoint .InvokeAsync( nameof(IRemoteHostService.InitializeGlobalState), new object?[] { uiCultureLCIDE, cultureLCID }, CancellationToken.None ) .ConfigureAwait(false); instance.Started(); // return instance return(instance); }
public ServiceProvider(TraceSource traceSource, RemoteHostTestData testData) { TraceSource = traceSource; TestData = testData; }
public static async Task <RemoteHostClient> CreateAsync(HostWorkspaceServices services, RemoteHostTestData testData) { var inprocServices = new InProcRemoteServices(testData); var remoteHostStream = await inprocServices.RequestServiceAsync(WellKnownServiceHubService.RemoteHost).ConfigureAwait(false); var clientId = $"InProc ({Guid.NewGuid()})"; var instance = new InProcRemoteHostClient(clientId, services, inprocServices, remoteHostStream); // make sure connection is done right var uiCultureLCIDE = 0; var cultureLCID = 0; await instance._endPoint.InvokeAsync( nameof(IRemoteHostService.InitializeGlobalState), new object?[] { uiCultureLCIDE, cultureLCID }, CancellationToken.None).ConfigureAwait(false); instance.Started(); // return instance return(instance); }
public static RemoteHostClient Create(HostWorkspaceServices services, RemoteServiceCallbackDispatcherRegistry callbackDispatchers, TraceListener?traceListener, RemoteHostTestData testData) { var inprocServices = new InProcRemoteServices(services, traceListener, testData); var instance = new InProcRemoteHostClient(services, inprocServices, callbackDispatchers); instance.Started(); // return instance return(instance); }