Skip to content

Commit

Permalink
Improve generator perf (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceroypenguin authored Feb 2, 2025
1 parent 5ce226d commit e7ea085
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Scriban;

namespace Immediate.Validations.Generators;
Expand All @@ -11,8 +12,8 @@ public void Initialize(IncrementalGeneratorInitializationContext context)
var validations = context.SyntaxProvider
.ForAttributeWithMetadataName(
"Immediate.Validations.Shared.ValidateAttribute",
(_, _) => true,
(ctx, ct) => new ValidateTargetTransformer(ctx, ct).Transform()
predicate: (node, _) => node is TypeDeclarationSyntax,
transform: (ctx, ct) => new ValidateTargetTransformer(ctx, ct).Transform()
)
.Where(m => m != null);

Expand Down

0 comments on commit e7ea085

Please sign in to comment.