private async Task<Solution> MakeMethodNameAsync(Document document, MethodDeclarationSyntax methodStmt, CancellationToken cancellationToken)
{
var identifierToken = methodStmt.Identifier;
var newName = identifierToken.Text + "Async";
// Get the symbol representing the type to be renamed.
var semanticModel = await document.GetSemanticModelAsync(cancellationToken);
var methodSymbol = semanticModel.GetDeclaredSymbol(methodStmt, cancellationToken);
// Produce a new solution that has all references to that type renamed, including the declaration.
var originalSolution = document.Project.Solution;
var optionSet = originalSolution.Workspace.Options;
var newSolution = await Renamer.RenameSymbolAsync(document.Project.Solution, methodSymbol, newName, optionSet, cancellationToken).ConfigureAwait(false);
// Return the new solution with the now-uppercase type name.
return newSolution;
}
}