Exemplo n.º 1
0
        /// <summary>
        ///     Called when the server process has exited.
        /// </summary>
        /// <param name="sender">
        ///     The event sender.
        /// </param>
        /// <param name="args">
        ///     The event arguments.
        /// </param>
        void ServerProcess_Exit(object sender, EventArgs args)
        {
            Log.LogDebug("Server process has exited.");

            OnExited();
            ServerExitCompletion.TrySetResult(null);
            ServerStartCompletion = new TaskCompletionSource <object>();
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Stop the server.
        /// </summary>
        /// <returns>
        ///     A <see cref="Task"/> representing the operation.
        /// </returns>
        public override Task Stop()
        {
            ServerStartCompletion = new TaskCompletionSource <object>();

            CloseStreams();

            ServerExitCompletion.TrySetResult(null);

            return(Task.CompletedTask);
        }
Exemplo n.º 3
0
 public override async Task Start()
 {
     _languageServer = DLanguageServerFactory.CreateServer(InputStream, OutputStream)
                       .ContinueWith(task =>
     {
         task.Result.WaitForExit.ContinueWith(task1 =>
         {
             OnExited();
             ServerExitCompletion.TrySetResult(null);
             ServerStartCompletion = new TaskCompletionSource <object>();
         });
         return(task.Result);
     });
     _running = true;
     await Task.CompletedTask;
 }