11using System.Collections.Generic;
22 public IList<ExtractedTypeDefinition>
Targets =
new List<ExtractedTypeDefinition>();
30 SyntaxNode syntaxNode;
32 DefinitionExtractionContext context;
35 syntaxNode = generatorSyntaxContext.Node;
36 model = generatorSyntaxContext.SemanticModel;
38 if (syntaxNode is not TypeDeclarationSyntax typeDeclarationSyntax)
return;
39 context =
new DefinitionExtractionContext(generatorSyntaxContext);
41 if (context.IsTypeAutoSerializable(typeDeclarationSyntax))
43 typeDefinition = TypeDefinitionExtractor.ExtractTypeDefinition(context, typeDeclarationSyntax);
Determine the types for which we must perform source generation
IList< ExtractedTypeDefinition > Targets
void OnVisitSyntaxNode(GeneratorSyntaxContext generatorSyntaxContext)
Test syntax nodes to see if they represent a type for which we must generate code