Skip to content

Commit

Permalink
Add watson information.
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed Jul 21, 2020
1 parent 7339398 commit df15b41
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.Editor.Shared.Utilities;
using Microsoft.CodeAnalysis.ErrorReporting;
using Microsoft.CodeAnalysis.Shared.Utilities;
using Microsoft.VisualStudio.Language.Intellisense;
using Microsoft.VisualStudio.Text;
Expand Down Expand Up @@ -51,7 +53,16 @@ public sealed override Task<IEnumerable<SuggestedActionSet>> GetActionSetsAsync(
protected override void InnerInvoke(IProgressTracker progressTracker, CancellationToken cancellationToken)
{
// A code action with nested actions is itself never invokable. So just do nothing if this ever gets asked.
Debug.Fail("Invoke should not be called on a SuggestedActionWithNestedActions");
// Report a message in debug and log a watson exception so that if this is hit we can try to narrow down how
// this happened.
Debug.Fail("InnerInvoke should not be called on a SuggestedActionWithNestedActions");
try
{
throw new InvalidOperationException("Invoke should not be called on a SuggestedActionWithNestedActions");
}
catch (Exception e) when (FatalError.ReportWithoutCrash(e))
{
}
}
}
}

0 comments on commit df15b41

Please sign in to comment.