File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,26 @@ private Task Start(Func<Task> request)
34
34
return t ;
35
35
}
36
36
37
+ private List < Task > RemoveCompleteTasks ( List < Task > list )
38
+ {
39
+ if ( list . Count == 0 ) return list ;
40
+
41
+ var result = new List < Task > ( ) ;
42
+ foreach ( var t in list )
43
+ {
44
+ if ( t . IsFaulted )
45
+ {
46
+ // TODO: Handle Fault
47
+ }
48
+ else if ( ! t . IsCompleted )
49
+ {
50
+ result . Add ( t ) ;
51
+ }
52
+ }
53
+ return result ;
54
+ }
55
+
56
+
37
57
private void ProcessRequestQueue ( )
38
58
{
39
59
// see https://github.com/OmniSharp/csharp-language-server-protocol/issues/4
@@ -49,7 +69,6 @@ private void ProcessRequestQueue()
49
69
if ( type == RequestProcessType . Serial )
50
70
{
51
71
Task . WaitAll ( waitables . ToArray ( ) , token ) ;
52
- waitables . Clear ( ) ;
53
72
Start ( request ) . Wait ( token ) ;
54
73
}
55
74
else if ( type == RequestProcessType . Parallel )
@@ -58,6 +77,7 @@ private void ProcessRequestQueue()
58
77
}
59
78
else
60
79
throw new NotImplementedException ( "Only Serial and Parallel execution types can be handled currently" ) ;
80
+ waitables = RemoveCompleteTasks ( waitables ) ;
61
81
}
62
82
}
63
83
}
You can’t perform that action at this time.
0 commit comments