13 references to RegisterForPostInitialization
Microsoft.CodeAnalysis (1)
SourceGeneration\GeneratorContexts.cs (1)
252/// Context passed to a source generator when it has opted-in to PostInitialization via <see cref="GeneratorInitializationContext.RegisterForPostInitialization(Action{GeneratorPostInitializationContext})"/>
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (12)
SourceGeneration\GeneratorDriverTests.cs (8)
892var generator = new CallbackGenerator((ic) => ic.RegisterForPostInitialization(postInit), (sgc) => { }); 919var generator = new CallbackGenerator((ic) => ic.RegisterForPostInitialization(postInit), (sgc) => { dSymbol = sgc.Compilation.GetTypeByMetadataName("D"); }, source = "public class E : D {}"); 946var generator = new CallbackGenerator((ic) => ic.RegisterForPostInitialization(postInit), (sgc) => { }); 976var generator = new CallbackGenerator((ic) => ic.RegisterForPostInitialization(postInit), (sgc) => executeCount++, source = "public class E : D {}"); 1006var generator = new CallbackGenerator((ic) => ic.RegisterForPostInitialization(postInit), (sgc) => Assert.True(false, "Should not execute"), source = "public class E : D {}"); 1031context.RegisterForPostInitialization(postInit); 1063var generator = new CallbackGenerator((ic) => ic.RegisterForPostInitialization(pic => pic.AddSource("postInit", "public class D{}")), (sgc) => { }, "public class E{}"); 1090var generator = new CallbackGenerator((ic) => ic.RegisterForPostInitialization(pic => pic.AddSource("postInit", "public class D{}")), (sgc) => { }, "public class E{}");
SourceGeneration\SyntaxAwareGeneratorTests.cs (4)
629i.RegisterForPostInitialization((pic) => throw exception); 683i.RegisterForPostInitialization((pic) => pic.AddSource("postInit", source2)); 742onInit: (i) => i.RegisterForPostInitialization((pic) => pic.AddSource("postInit", source2)), 799i.RegisterForPostInitialization((pic) => pic.AddSource("postInit", postInitSource));