public static void ComputeRefactorings(RefactoringContext context, WhileStatementSyntax whileStatement)
 {
     if (context.IsRefactoringEnabled(RefactoringIdentifiers.ReplaceWhileStatementWithDoStatement) &&
         (whileStatement.WhileKeyword.Span.Contains(context.Span)))
     {
         context.RegisterRefactoring(
             "Replace while with do",
             cancellationToken =>
         {
             return(ReplaceWhileStatementWithDoStatementRefactoring.RefactorAsync(
                        context.Document,
                        whileStatement,
                        cancellationToken));
         });
     }
 }
        public static async Task ComputeRefactoringsAsync(RefactoringContext context, WhileStatementSyntax whileStatement)
        {
            if (context.IsRefactoringEnabled(RefactoringIdentifiers.AddBooleanComparison) &&
                whileStatement.Condition != null &&
                whileStatement.Condition.Span.Contains(context.Span) &&
                context.SupportsSemanticModel)
            {
                await AddBooleanComparisonRefactoring.ComputeRefactoringAsync(context, whileStatement.Condition).ConfigureAwait(false);
            }

            if (context.IsRefactoringEnabled(RefactoringIdentifiers.ReplaceWhileStatementWithDoStatement) &&
                (whileStatement.WhileKeyword.Span.Contains(context.Span)))
            {
                context.RegisterRefactoring(
                    "Replace while with do",
                    cancellationToken =>
                {
                    return(ReplaceWhileStatementWithDoStatementRefactoring.RefactorAsync(
                               context.Document,
                               whileStatement,
                               cancellationToken));
                });
            }
        }