public virtual void VisitImportDeclarationSyntax(ImportDeclarationSyntax syntax) { this.VisitNodes(syntax.LeadingNodes); this.Visit(syntax.Keyword); this.Visit(syntax.ProviderName); this.Visit(syntax.AsKeyword); this.Visit(syntax.AliasName); this.Visit(syntax.Config); }
protected virtual SyntaxBase ReplaceImportDeclarationSyntax(ImportDeclarationSyntax syntax) { var hasChanges = TryRewrite(syntax.LeadingNodes, out var leadingNodes); hasChanges |= TryRewriteStrict(syntax.Keyword, out var keyword); hasChanges |= TryRewriteStrict(syntax.ProviderName, out var providerName); hasChanges |= TryRewriteStrict(syntax.AsKeyword, out var asKeyword); hasChanges |= TryRewriteStrict(syntax.AliasName, out var aliasName); hasChanges |= TryRewrite(syntax.Config, out var config); if (!hasChanges) { return(syntax); } return(new ImportDeclarationSyntax(leadingNodes, keyword, aliasName, asKeyword, providerName, config)); }
void ISyntaxVisitor.VisitImportDeclarationSyntax(ImportDeclarationSyntax syntax) => ReplaceCurrent(syntax, ReplaceImportDeclarationSyntax);