File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,13 @@ private void HandleRequest(string request)
172172 }
173173 }
174174
175+ private Task Start ( Func < Task > request )
176+ {
177+ var t = request ( ) ;
178+ t . Start ( ) ;
179+ return t ;
180+ }
181+
175182 private async void ProcessRequestQueue ( )
176183 {
177184 // see https://github.com/OmniSharp/csharp-language-server-protocol/issues/4
@@ -183,18 +190,15 @@ private async void ProcessRequestQueue()
183190 if ( _queue . TryTake ( out var item , Timeout . Infinite , token ) )
184191 {
185192 var ( type , request ) = item ;
186- var task = request ( ) ;
187193 if ( type == RequestProcessType . Serial )
188194 {
189195 await Task . WhenAll ( waitables ) ;
190196 waitables . Clear ( ) ;
191- task . Start ( ) ;
192- await task ;
197+ await Start ( request ) ;
193198 }
194199 else if ( type == RequestProcessType . Parallel )
195200 {
196- task . Start ( ) ;
197- waitables . Add ( task ) ;
201+ waitables . Add ( Start ( request ) ) ;
198202 }
199203 else
200204 throw new NotImplementedException ( "Only Serial and Parallel execution types can be handled currently" ) ;
You can’t perform that action at this time.
0 commit comments