public void Initialize(GeneratorInitializationContext context) { #if DEBUG Debugger.Launch(); #endif context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); }
public void Initialize(GeneratorInitializationContext context) { // System.Diagnostics.Debugger.Launch(); context.RegisterForPostInitialization((i) => i.AddSource("StaticViewLocatorAttribute.cs", SourceText.From(AttributeText, Encoding.UTF8))); context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); }
public void Initialize(GeneratorInitializationContext context) { context.RegisterForSyntaxNotifications(() => new FunctionSyntaxContextReceiver()); _mfCodeTemplate = Template.Parse(Templates.MemberFunctions); _vfCodeTemplate = Template.Parse(Templates.VirtualFunctions); }
public void Initialize(GeneratorInitializationContext context) { const string attribute = @"// <auto-generated /> using Microsoft.Extensions.DependencyInjection; [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] internal class InjectAttribute : System.Attribute { internal InjectAttribute(ServiceLifetime serviceLifetime = ServiceLifetime.Transient) { } } [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] internal class InjectSingletonAttribute : System.Attribute { } [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] internal class InjectScopedAttribute : System.Attribute { } [System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple = false, Inherited = false)] internal class InjectTransientAttribute : System.Attribute { } "; context.RegisterForPostInitialization(context => context.AddSource("Inject.Generated.cs", SourceText.From(attribute, Encoding.UTF8))); context.RegisterForSyntaxNotifications(() => new ServicesReceiver()); }
public void Initialize(GeneratorInitializationContext context) { var receiver = new SyntaxReceiver(); context.RegisterForSyntaxNotifications(() => receiver); context.RegisterForPostInitialization(receiver.PostInititialize); }
public void Initialize( GeneratorInitializationContext context) { context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); context.RegisterForPostInitialization(this.PostInitialize); }
public void Initialize(GeneratorInitializationContext context) { #if DEBUG //if (!Debugger.IsAttached) { Debugger.Launch(); } #endif context.RegisterForSyntaxNotifications(() => new CSVAttrReveiver()); }
public void Initialize(GeneratorInitializationContext context) { #if (!Roslyn3_8) context.RegisterForPostInitialization(PostInitializationCallback); #endif context.RegisterForSyntaxNotifications(HelloWorldReceiver.Create); }
public void Initialize(GeneratorInitializationContext context) { #if DEBUG System.Diagnostics.Debugger.Launch(); #endif context.RegisterForSyntaxNotifications(() => new JsonDiscriminatorReceiver()); }
public void Initialize(GeneratorInitializationContext context) { context.RegisterForSyntaxNotifications(() => new SyntaxCollector()); context.RegisterForPostInitialization(c => { c.AddSource("Attributes.cs", ReadAttributesFile()); }); }
public override void Initialize(GeneratorInitializationContext context) { //if (!Debugger.IsAttached) //Debugger.Launch(); // Register a syntax receiver that will be created for each generation pass context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); }
public void Initialize(GeneratorInitializationContext context) { var file = "StrongTypeId.sbntxt"; template = Template.Parse(EmbeddedResource.GetContent(file), file); context.RegisterForSyntaxNotifications(() => new StrongTypeIdReceiver()); }
public void Initialize(GeneratorInitializationContext context) { #if MVVMGEN_PURECODEGENERATION context.RegisterForPostInitialization(PureCodeGenerationLibraryLoader.AddLibraryFilesToContext); #endif context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); }
public void Initialize(GeneratorInitializationContext context) { context.RegisterForPostInitialization(pi => { pi.AddSource("TypedId_Attrs_", AttributeSource); pi.AddSource("TypedId_Enums_IdBackingType", IdBackingTypeSource); }); context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); }
public void Initialize(GeneratorInitializationContext context) { // Register the attribute source context.RegisterForPostInitialization((i) => i.AddSource("AutoNotifyAttribute", attributeText)); // Register a syntax receiver that will be created for each generation pass context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); }
public void Initialize(GeneratorInitializationContext context) { if (!Debugger.IsAttached) { Debugger.Launch(); } context.RegisterForSyntaxNotifications(() => new MethodDeclarationSyntaxReceiver()); }
public void Syntax_Receiver_Can_Be_Registered_Only_Once() { // ISyntaxReceiver + ISyntaxReceiver GeneratorInitializationContext init = new GeneratorInitializationContext( CancellationToken.None ); init.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()); Assert.Throws <InvalidOperationException>( () => { init.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()); } ); // ISyntaxContextReceiver + ISyntaxContextReceiver init = new GeneratorInitializationContext(CancellationToken.None); init.RegisterForSyntaxNotifications(() => new TestSyntaxContextReceiver()); Assert.Throws <InvalidOperationException>( () => { init.RegisterForSyntaxNotifications(() => new TestSyntaxContextReceiver()); } ); // ISyntaxContextReceiver + ISyntaxReceiver init = new GeneratorInitializationContext(CancellationToken.None); init.RegisterForSyntaxNotifications(() => new TestSyntaxContextReceiver()); Assert.Throws <InvalidOperationException>( () => { init.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()); } ); // ISyntaxReceiver + ISyntaxContextReceiver init = new GeneratorInitializationContext(CancellationToken.None); init.RegisterForSyntaxNotifications(() => new TestSyntaxReceiver()); Assert.Throws <InvalidOperationException>( () => { init.RegisterForSyntaxNotifications(() => new TestSyntaxContextReceiver()); } ); }
public void Initialize(GeneratorInitializationContext context) { if (!Debugger.IsAttached) { // Debugger.Launch(); } context.RegisterForSyntaxNotifications(() => new TestDataReceiver()); }
public void Initialize(GeneratorInitializationContext context) { #if DEBUG //if (!Debugger.IsAttached) //Debugger.Launch(); #endif context.RegisterForSyntaxNotifications(() => new AlpakaEventSyntaxReceiver()); }
public void Initialize(GeneratorInitializationContext context) { #if DEBUG if (!System.Diagnostics.Debugger.IsAttached) { //System.Diagnostics.Debugger.Launch(); } #endif context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); }
public void Initialize(GeneratorInitializationContext context) { context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); //if (!Debugger.IsAttached) //{ // Debugger.Launch(); //} Debug.WriteLine("Initalize code generator"); }
public void Initialize(GeneratorInitializationContext context) { if (!context.CancellationToken.IsCancellationRequested) { #region manully toggle debugger // Debugger.Launch(); #endregion context.RegisterForSyntaxNotifications(() => new MappingSyntaxReceiver()); } }
public void Initialize(GeneratorInitializationContext context) { #if DEBUG if (!Debugger.IsAttached) { Debugger.Launch(); SpinWait.SpinUntil(() => Debugger.IsAttached); } #endif context.RegisterForSyntaxNotifications(() => new BitPackerSyntaxReceiver()); }
public void Initialize(GeneratorInitializationContext context) { /*#if DEBUG * if (!Debugger.IsAttached) * Debugger.Launch(); #endif*/ context.RegisterForSyntaxNotifications(() => new ExcelContextReceiver()); context.RegisterForPostInitialization(ctx => ctx.AddSource("ExcelProviderAttribute.cs", Extensions.GetEmbeddedSourceCode("Maestria.TypeProviders.Excel.ExcelProviderAttribute.cs"))); }
/// <summary> /// Initialise the generator prior to performing any work /// </summary> /// <param name="context">The execution context provided by the Roslyn compiler</param> public void Initialize(GeneratorInitializationContext context) { #if (DEBUG) //// Uncomment this to enable debugging of the source generator //if (!Debugger.IsAttached) //{ // Debugger.Launch(); //} #endif context.RegisterForSyntaxNotifications(() => new AutoSerializableReceiver()); }
public void Initialize(GeneratorInitializationContext context) { #if DEBUG if (!Debugger.IsAttached) { Debugger.Launch(); } #endif var componentSyntaxReceiver = new ComponentSyntaxReceiver(); context.RegisterForSyntaxNotifications(() => componentSyntaxReceiver); }
public override void Initialize(GeneratorInitializationContext context) { //#if DEBUG //if (!debugger.isattached) //{ // debugger.launch(); //} //#endif context.RegisterForSyntaxNotifications(() => new StaticMethodCallSyntaxReceiver(NamespaceName, ClassName, MethodName, 1, 1, 0, 0)); }
public void Initialize(GeneratorInitializationContext context) { #if DEBUG Debugger.Launch(); #endif // Register the attribute source context.RegisterForPostInitialization((i) => i.AddSource("MVVMViewModelAttribute", attributeText)); // Register a syntax receiver that will be created for each generation pass context.RegisterForSyntaxNotifications(() => new SyntaxReceiver()); }