public static void Main(string[] args) { CheckDebugMode(); using (CoreShell.Create()) { var services = CoreShell.Current.ServiceManager; using (var cin = Console.OpenStandardInput()) using (var cout = Console.OpenStandardOutput()) using (var server = new LanguageServer()) using (var rpc = JsonRpc.Attach(cout, cin, server)) { services.AddService(new UIService(rpc)); services.AddService(new TelemetryService(rpc)); var token = server.Start(services, rpc); // Wait for the "shutdown" request. token.WaitHandle.WaitOne(); } } }
public static void Main(string[] args) { CheckDebugMode(); using (CoreShell.Create()) { var services = CoreShell.Current.ServiceManager; using (var cin = Console.OpenStandardInput()) using (var cout = Console.OpenStandardOutput()) using (var server = new LanguageServer()) using (var rpc = new JsonRpc(cout, cin, server)) { var ui = new UIService(rpc); rpc.SynchronizationContext = new SingleThreadSynchronizationContext(ui); services.AddService(ui); services.AddService(new TelemetryService(rpc)); var token = server.Start(services, rpc); rpc.StartListening(); // Wait for the "shutdown" request. token.WaitHandle.WaitOne(); } } }