public override Task <IReadOnlyList <MemberDeclarationSyntax> > GenerateAsync(MemberDeclarationSyntax applyTo, Document document, IProgressAndErrors progress, CancellationToken cancellationToken)
        {
            var options = new CodeGen.Options
            {
                GenerateBuilder              = this.GenerateBuilder,
                Delta                        = this.Delta,
                DefineInterface              = this.DefineInterface,
                DefineRootedStruct           = this.DefineRootedStruct,
                DefineWithMethodsPerProperty = this.DefineWithMethodsPerProperty,
            };

            return(CodeGen.GenerateAsync((ClassDeclarationSyntax)applyTo, document, progress, options, cancellationToken));
        }
Ejemplo n.º 2
0
        public Task <SyntaxList <MemberDeclarationSyntax> > GenerateAsync(MemberDeclarationSyntax applyTo, Document document, IProgress <Diagnostic> progress, CancellationToken cancellationToken)
        {
            Requires.NotNull(applyTo, nameof(applyTo));

            var options = new CodeGen.Options(this.attributeData)
            {
                GenerateBuilder              = this.GetBoolData(nameof(GenerateImmutableAttribute.GenerateBuilder)),
                Delta                        = this.GetBoolData(nameof(GenerateImmutableAttribute.Delta)),
                DefineInterface              = this.GetBoolData(nameof(GenerateImmutableAttribute.DefineInterface)),
                DefineRootedStruct           = this.GetBoolData(nameof(GenerateImmutableAttribute.DefineRootedStruct)),
                DefineWithMethodsPerProperty = this.GetBoolData(nameof(GenerateImmutableAttribute.DefineWithMethodsPerProperty)),
            };

            return(CodeGen.GenerateAsync((ClassDeclarationSyntax)applyTo, document, progress, options, cancellationToken));
        }
        public Task <SyntaxList <MemberDeclarationSyntax> > GenerateAsync(TransformationContext context, IProgress <Diagnostic> progress, CancellationToken cancellationToken)
        {
            Requires.NotNull(context, nameof(context));

            var options = new CodeGen.Options(this.attributeData)
            {
                GenerateBuilder              = this.GetBoolData(nameof(GenerateImmutableAttribute.GenerateBuilder)),
                Delta                        = this.GetBoolData(nameof(GenerateImmutableAttribute.Delta)),
                DefineInterface              = this.GetBoolData(nameof(GenerateImmutableAttribute.DefineInterface)),
                DefineRootedStruct           = this.GetBoolData(nameof(GenerateImmutableAttribute.DefineRootedStruct)),
                DefineWithMethodsPerProperty = this.GetBoolData(nameof(GenerateImmutableAttribute.DefineWithMethodsPerProperty)),
            };

            return(CodeGen.GenerateAsync((ClassDeclarationSyntax)context.ProcessingNode, context.SemanticModel, progress, options, cancellationToken));
        }
        public Task<IReadOnlyList<MemberDeclarationSyntax>> GenerateAsync(MemberDeclarationSyntax applyTo, Document document, IProgress<Diagnostic> progress, CancellationToken cancellationToken)
        {
            Requires.NotNull(applyTo, nameof(applyTo));

            var options = new CodeGen.Options(this.attributeData)
            {
                GenerateBuilder = this.GetBoolData(nameof(GenerateImmutableAttribute.GenerateBuilder)),
                Delta = this.GetBoolData(nameof(GenerateImmutableAttribute.Delta)),
                DefineInterface = this.GetBoolData(nameof(GenerateImmutableAttribute.DefineInterface)),
                DefineRootedStruct = this.GetBoolData(nameof(GenerateImmutableAttribute.DefineRootedStruct)),
                DefineWithMethodsPerProperty = this.GetBoolData(nameof(GenerateImmutableAttribute.DefineWithMethodsPerProperty)),
            };

            return CodeGen.GenerateAsync((ClassDeclarationSyntax)applyTo, document, progress, options, cancellationToken);
        }