File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ public static partial class GeneralNames
1111 }
1212
1313 [ Serial , Method ( Shutdown ) ]
14- public interface IShutdownHandler : INotificationHandler { }
14+ public interface IShutdownHandler : IRequestHandler < object > { }
1515}
Original file line number Diff line number Diff line change 1+ using System . Threading ;
12using System . Threading . Tasks ;
23using OmniSharp . Extensions . LanguageServer . Protocol ;
34using OmniSharp . Extensions . LanguageServer . Server . Abstractions ;
@@ -6,19 +7,18 @@ namespace OmniSharp.Extensions.LanguageServer.Server.Handlers
67{
78 public class ShutdownHandler : IShutdownHandler , IAwaitableTermination
89 {
9- public Task Handle ( )
10+ public event ShutdownEventHandler Shutdown ;
11+
12+ public bool ShutdownRequested { get ; private set ; }
13+
14+ private readonly TaskCompletionSource < bool > _shutdownSource = new TaskCompletionSource < bool > ( TaskContinuationOptions . LongRunning ) ;
15+ Task IAwaitableTermination . WasShutDown => _shutdownSource . Task ;
16+ public Task Handle ( object request , CancellationToken token )
1017 {
1118 ShutdownRequested = true ;
1219 Shutdown ? . Invoke ( ShutdownRequested ) ;
13- shutdownSource . SetResult ( true ) ; // after all event sinks were notified
20+ _shutdownSource . SetResult ( true ) ; // after all event sinks were notified
1421 return Task . CompletedTask ;
1522 }
16-
17- public event ShutdownEventHandler Shutdown ;
18-
19- public bool ShutdownRequested { get ; private set ; }
20-
21- private readonly TaskCompletionSource < bool > shutdownSource = new TaskCompletionSource < bool > ( TaskContinuationOptions . LongRunning ) ;
22- Task IAwaitableTermination . WasShutDown => shutdownSource . Task ;
2323 }
2424}
You can’t perform that action at this time.
0 commit comments