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)
892
var generator = new CallbackGenerator((ic) => ic.
RegisterForPostInitialization
(postInit), (sgc) => { });
919
var generator = new CallbackGenerator((ic) => ic.
RegisterForPostInitialization
(postInit), (sgc) => { dSymbol = sgc.Compilation.GetTypeByMetadataName("D"); }, source = "public class E : D {}");
946
var generator = new CallbackGenerator((ic) => ic.
RegisterForPostInitialization
(postInit), (sgc) => { });
976
var generator = new CallbackGenerator((ic) => ic.
RegisterForPostInitialization
(postInit), (sgc) => executeCount++, source = "public class E : D {}");
1006
var generator = new CallbackGenerator((ic) => ic.
RegisterForPostInitialization
(postInit), (sgc) => Assert.True(false, "Should not execute"), source = "public class E : D {}");
1031
context.
RegisterForPostInitialization
(postInit);
1063
var generator = new CallbackGenerator((ic) => ic.
RegisterForPostInitialization
(pic => pic.AddSource("postInit", "public class D{}")), (sgc) => { }, "public class E{}");
1090
var generator = new CallbackGenerator((ic) => ic.
RegisterForPostInitialization
(pic => pic.AddSource("postInit", "public class D{}")), (sgc) => { }, "public class E{}");
SourceGeneration\SyntaxAwareGeneratorTests.cs (4)
629
i.
RegisterForPostInitialization
((pic) => throw exception);
683
i.
RegisterForPostInitialization
((pic) => pic.AddSource("postInit", source2));
742
onInit: (i) => i.
RegisterForPostInitialization
((pic) => pic.AddSource("postInit", source2)),
799
i.
RegisterForPostInitialization
((pic) => pic.AddSource("postInit", postInitSource));