Cleanup.
This commit is contained in:
parent
1968184e77
commit
4734b8170a
|
@ -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<TypeOfExpressionSyntax>()
|
||||
.SingleOrDefault();
|
||||
|
|
|
@ -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 } }
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -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";
|
Loading…
Reference in New Issue