Example #1
0
        private static SyntaxNode Transform(SyntaxNode oldNode, SyntaxNode newNode, Scope scope, LexicalExtension <SyntaxToken> extension)
        {
            Debug.Assert(newNode is AnonymousObjectCreationExpressionSyntax);
            var result = createJson.Get(newNode);

            var isAssignment = false;

            result = Roslyn.ReplaceAssignment(oldNode, result, out isAssignment);
            if (!isAssignment)
            {
                scope.AddError("json01", "json expects to be assigned", oldNode);
                return(newNode);
            }

            return(result);
        }