private static Task <Document> ApplyFixAsync(CodeFixContext context, SyntaxNode syntaxRoot, SemanticModel semanticModel, ArgumentSyntax argument, bool isMember) { var text = ((LiteralExpressionSyntax)argument.Expression).Token.ValueText; var identifierNameSyntax = SyntaxFactory.IdentifierName(text); var expression = isMember && !argument.UsesUnderscoreNames(semanticModel, context.CancellationToken) ? SyntaxFactory.MemberAccessExpression( SyntaxKind.SimpleMemberAccessExpression, SyntaxFactory.ThisExpression(), identifierNameSyntax) : (ExpressionSyntax)identifierNameSyntax; var argumentList = SyntaxFactory.ArgumentList( SyntaxFactory.SingletonSeparatedList( SyntaxFactory.Argument(expression))); var nameofInvocation = SyntaxFactory.InvocationExpression(NameofIdentifier, argumentList); return(Task.FromResult(context.Document.WithSyntaxRoot(syntaxRoot.ReplaceNode(argument, argument.WithExpression(nameofInvocation))))); }