Exemplo n.º 1
0
        public override SyntaxNode VisitGenericName(GenericNameSyntax node)
        {
            node = (GenericNameSyntax)base.VisitGenericName(node);

            var type = _context.GetNodeType(node);

            if (ConstructFullClassName(type) == ConstructFullClassName(Type) &&
                TokenIsType(node.Identifier, type))
            {
                node = node.WithIdentifier(SyntaxFactory.Identifier(NewName)
                                           .WithTrailingTrivia(node.Identifier.TrailingTrivia)
                                           .WithLeadingTrivia(node.Identifier.LeadingTrivia));

                node = node.CopyAnnotationsTo(node);
            }

            return(node);
        }
Exemplo n.º 2
0
        public override SyntaxNode VisitIdentifierName(IdentifierNameSyntax node)
        {
            node = (IdentifierNameSyntax)base.VisitIdentifierName(node);

            if (_context.GetNodeType(node) == _type)
            {
                node = node.WithIdentifier(SyntaxFactory.Identifier(_newType)
                                           .WithTrailingTrivia(node.Identifier.TrailingTrivia)
                                           .WithLeadingTrivia(node.Identifier.LeadingTrivia));

                node = node.CopyAnnotationsTo(node);
            }

            return(node);
        }