File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/EditorFeatures/Core/IntelliSense Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -146,8 +146,10 @@ public void ChainTaskAndNotifyControllerWhenFinished(
146146
147147 async Task < TModel > TransformModelAsync ( Task < TModel > lastTask )
148148 {
149- // Ensure we're on the BG before doing any model transformation work.
150- await TaskScheduler . Default ;
149+ // Ensure we're on the BG before doing any model transformation work. Also, ensure we yield so that we don't
150+ // end up with an enormously long chain of tasks unwinding. That can otherwise cause a stack overflow if
151+ // this chain gets too long.
152+ await Task . Yield ( ) . ConfigureAwait ( false ) ;
151153 var model = await lastTask . ConfigureAwait ( false ) ;
152154 return await transformModelAsync ( model , _stopCancellationToken ) . ConfigureAwait ( false ) ;
153155 }
You can’t perform that action at this time.
0 commit comments