<commit_before>using Roslyn.Compilers.CSharp;

namespace Compilify.Extensions
{
    internal static class SyntaxTreeExtensions
    {
        internal static SyntaxTree RewriteWith<TRewriter>(this SyntaxTree tree) where TRewriter : SyntaxRewriter, new()
        {
            var rewriter = new TRewriter();
            return SyntaxTree.Create(tree.FileName, (CompilationUnitSyntax)rewriter.Visit(tree.Root), tree.Options);
        }
    }<commit_msg>Adding a new overload for the RewriteWith extension method<commit_after>using Roslyn.Compilers.CSharp;

namespace Compilify.Extensions
{
    internal static class SyntaxTreeExtensions
    {
        internal static SyntaxTree RewriteWith<TRewriter>(this SyntaxTree tree) where TRewriter : SyntaxRewriter, new()
        {
            return tree.RewriteWith(new TRewriter());
        }

        internal static SyntaxTree RewriteWith<TRewriter>(this SyntaxTree tree, TRewriter rewriter) where TRewriter : SyntaxRewriter
        {
            return SyntaxTree.Create(tree.FileName, (CompilationUnitSyntax)rewriter.Visit(tree.Root), tree.Options);
        }
    }
{'fraction_non_alphanumeric': 0.0774077407740774, 'fraction_numerical': 0.0, 'mean_word_length': 3.465863453815261, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '396828', 'n_tokens_mistral': 321, 'n_tokens_neox': 303, 'n_words': 70}