File tree 2 files changed +10
-10
lines changed
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
11
11
}
12
12
13
13
[ Serial , Method ( Shutdown ) ]
14
- public interface IShutdownHandler : INotificationHandler { }
14
+ public interface IShutdownHandler : IRequestHandler < object > { }
15
15
}
Original file line number Diff line number Diff line change
1
+ using System . Threading ;
1
2
using System . Threading . Tasks ;
2
3
using OmniSharp . Extensions . LanguageServer . Protocol ;
3
4
using OmniSharp . Extensions . LanguageServer . Server . Abstractions ;
@@ -6,19 +7,18 @@ namespace OmniSharp.Extensions.LanguageServer.Server.Handlers
6
7
{
7
8
public class ShutdownHandler : IShutdownHandler , IAwaitableTermination
8
9
{
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 )
10
17
{
11
18
ShutdownRequested = true ;
12
19
Shutdown ? . Invoke ( ShutdownRequested ) ;
13
- shutdownSource . SetResult ( true ) ; // after all event sinks were notified
20
+ _shutdownSource . SetResult ( true ) ; // after all event sinks were notified
14
21
return Task . CompletedTask ;
15
22
}
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 ;
23
23
}
24
24
}
You can’t perform that action at this time.
0 commit comments