diff --git a/ReSharper.FSharp/src/FSharp/FSharp.ProjectModelBase/src/FSharpAsyncUtil.cs b/ReSharper.FSharp/src/FSharp/FSharp.ProjectModelBase/src/FSharpAsyncUtil.cs index 2d298c0f27..d3a666eb52 100644 --- a/ReSharper.FSharp/src/FSharp/FSharp.ProjectModelBase/src/FSharpAsyncUtil.cs +++ b/ReSharper.FSharp/src/FSharp/FSharp.ProjectModelBase/src/FSharpAsyncUtil.cs @@ -46,19 +46,7 @@ public static void CheckAndThrow() } else { - { - try - { - Interruption.Current.CheckAndThrow(); - } - catch (Exception e) when (e.IsOperationCanceled()) - { - var logger = Logger.GetLogger(typeof(FSharpAsyncUtil)); - logger.Trace("Cancelled via Interruption.Current.CheckAndThrow()"); - throw; - } - } - + Interruption.Current.CheckAndThrow(); } } @@ -92,11 +80,11 @@ public static void UsingReadLockInsideFcs(IShellLocks locks, Action action) { logger.Trace("UsingReadLockInsideFcs: exception: the operation cancelled on the initial thread"); - // todo: what if this happens in F#->C#->F#? if (locks.IsReadAccessAllowed()) { // The FCS request has originated from a R# thread and was cancelled. We don't want to requeue this request. // If the request is coming from FCS, it's cancelled below in the loop. + // We could also check `Cancellable.HasCancellationToken` instead. logger.Trace("UsingReadLockInsideFcs: read lock was acquired before the request, rethrowing"); throw; }