Example #1
0
            static VisualStudioInProcLanguageServer CreateLanguageServer(Stream inputStream, Stream outputStream, TestWorkspace workspace, IDiagnosticService mockDiagnosticService)
            {
                var dispatcherFactory = workspace.ExportProvider.GetExportedValue <RequestDispatcherFactory>();
                var listenerProvider  = workspace.ExportProvider.GetExportedValue <IAsynchronousOperationListenerProvider>();
                var lspWorkspaceRegistrationService = workspace.ExportProvider.GetExportedValue <ILspWorkspaceRegistrationService>();
                var capabilitiesProvider            = workspace.ExportProvider.GetExportedValue <DefaultCapabilitiesProvider>();

                var jsonRpc = new JsonRpc(new HeaderDelimitedMessageHandler(outputStream, inputStream))
                {
                    ExceptionStrategy = ExceptionProcessing.ISerializable,
                };

                var languageServer = new VisualStudioInProcLanguageServer(
                    dispatcherFactory,
                    jsonRpc,
                    capabilitiesProvider,
                    lspWorkspaceRegistrationService,
                    listenerProvider,
                    NoOpLspLogger.Instance,
                    mockDiagnosticService,
                    clientName: null,
                    userVisibleServerName: string.Empty,
                    telemetryServerTypeName: string.Empty);

                jsonRpc.StartListening();
                return(languageServer);
            }
 internal TestAccessor(VisualStudioInProcLanguageServer server)
 {
     _server = server;
 }