Пример #1
0
        public override SyntaxNode VisitForEachStatement(ForEachStatementSyntax node)
        {
            // reassociate trivia from open paren to type expression
            node = node
                   .WithOpenParenToken(
                node.OpenParenToken.WithTrailingTrivia(SyntaxTriviaList.Empty))
                   .WithType(
                node.Type.WithLeadingTrivia(
                    node.OpenParenToken.TrailingTrivia.AddRange(node.Type.GetLeadingTrivia())));

            node = (ForEachStatementSyntax)base.VisitForEachStatement(node);
            return(node);
        }