File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
src/LanguageServer/Microsoft.CommonLanguageServerProtocol.Framework Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1212using System . Reflection ;
1313using System . Threading ;
1414using System . Threading . Tasks ;
15+ using Microsoft . VisualStudio . Threading ;
1516using StreamJsonRpc ;
1617
1718namespace Microsoft . CommonLanguageServerProtocol . Framework ;
@@ -326,18 +327,21 @@ private ValueTask ShutdownRequestExecutionQueueAsync()
326327 return queue . DisposeAsync ( ) ;
327328 }
328329
329- #pragma warning disable VSTHRD100
330330 /// <summary>
331331 /// Cleanup the server if we encounter a json rpc disconnect so that we can be restarted later.
332332 /// </summary>
333- private async void JsonRpc_Disconnected ( object ? sender , JsonRpcDisconnectedEventArgs e )
333+ private void JsonRpc_Disconnected ( object ? sender , JsonRpcDisconnectedEventArgs e )
334334 {
335- // It is possible this gets called during normal shutdown and exit.
336- // ShutdownAsync and ExitAsync will no-op if shutdown was already triggered by something else.
337- await ShutdownAsync ( message : "Shutdown triggered by JsonRpc disconnect" ) . ConfigureAwait ( false ) ;
338- await ExitAsync ( ) . ConfigureAwait ( false ) ;
335+ JsonRpc_DisconnectedAsync ( sender , e ) . Forget ( ) ;
336+
337+ async Task JsonRpc_DisconnectedAsync ( object ? sender , JsonRpcDisconnectedEventArgs e )
338+ {
339+ // It is possible this gets called during normal shutdown and exit.
340+ // ShutdownAsync and ExitAsync will no-op if shutdown was already triggered by something else.
341+ await ShutdownAsync ( message : "Shutdown triggered by JsonRpc disconnect" ) . ConfigureAwait ( false ) ;
342+ await ExitAsync ( ) . ConfigureAwait ( false ) ;
343+ }
339344 }
340- #pragma warning disable VSTHRD100
341345
342346 internal TestAccessor GetTestAccessor ( )
343347 {
You can’t perform that action at this time.
0 commit comments