public override async Task ComputeFixesAsync(CodeFixContext context)
{
var root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
var diagnostic = context.Diagnostics.First();
var diagnosticSpan = diagnostic.Location.SourceSpan;
var declaration = root.FindToken(diagnosticSpan.Start).Parent
.FirstAncestorOrSelf<AwaitExpressionSyntax>();
context.RegisterFix(
CodeAction.Create("Add ConfigureAwait(false)", cancellationToken =>
AddConfigureAwait(context.Document, declaration, false, cancellationToken)),
diagnostic);
context.RegisterFix(
CodeAction.Create("Add ConfigureAwait(true)", cancellationToken =>
AddConfigureAwait(context.Document, declaration, true, cancellationToken)),
diagnostic);
}