diff --git a/MapTo/MapToGenerator.cs b/MapTo/MapToGenerator.cs index 366faf7..56a24c9 100644 --- a/MapTo/MapToGenerator.cs +++ b/MapTo/MapToGenerator.cs @@ -34,7 +34,7 @@ namespace MapTo continue; } - var (source, hintName) = SourceProvider.GenerateSource(model); + var (source, hintName) = SourceBuilder.GenerateSource(model); context.AddSource(hintName, source); } @@ -74,7 +74,7 @@ namespace MapTo private static ITypeSymbol? GetDestinationTypeSymbol(ClassDeclarationSyntax classSyntax, SemanticModel model) { var destinationTypeExpressionSyntax = classSyntax - .GetAttribute(SourceProvider.MapFromAttributeName) + .GetAttribute(SourceBuilder.MapFromAttributeName) ?.DescendantNodes() .OfType() .SingleOrDefault(); diff --git a/MapTo/MapToSyntaxReceiver.cs b/MapTo/MapToSyntaxReceiver.cs index f4272bc..a150953 100644 --- a/MapTo/MapToSyntaxReceiver.cs +++ b/MapTo/MapToSyntaxReceiver.cs @@ -20,12 +20,12 @@ namespace MapTo var attributeSyntax = attributes .SelectMany(a => a.Attributes) .SingleOrDefault(a => a.Name is - IdentifierNameSyntax { Identifier: { ValueText: SourceProvider.MapFromAttributeName } } // For: [MapFrom] + IdentifierNameSyntax { Identifier: { ValueText: SourceBuilder.MapFromAttributeName } } // For: [MapFrom] or QualifiedNameSyntax // For: [MapTo.MapFrom] { - Left: IdentifierNameSyntax { Identifier: { ValueText: SourceProvider.NamespaceName } }, - Right: IdentifierNameSyntax { Identifier: { ValueText: SourceProvider.MapFromAttributeName } } + Left: IdentifierNameSyntax { Identifier: { ValueText: SourceBuilder.NamespaceName } }, + Right: IdentifierNameSyntax { Identifier: { ValueText: SourceBuilder.MapFromAttributeName } } } ); diff --git a/MapTo/SourceProvider.cs b/MapTo/SourceBuilder.cs similarity index 98% rename from MapTo/SourceProvider.cs rename to MapTo/SourceBuilder.cs index 62d73d0..3469f56 100644 --- a/MapTo/SourceProvider.cs +++ b/MapTo/SourceBuilder.cs @@ -5,11 +5,10 @@ using System.Text; using MapTo.Extensions; using MapTo.Models; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Text; namespace MapTo { - internal static class SourceProvider + internal static class SourceBuilder { internal const string NamespaceName = "MapTo"; internal const string MapFromAttributeName = "MapFrom";