public GeneratorState(GeneratorInfo info) : this(info, ImmutableArray <GeneratedSourceText> .Empty, ImmutableArray <SyntaxTree> .Empty, ImmutableArray <Diagnostic> .Empty, syntaxReceiver : null, exception : null) { }
public GeneratorState(GeneratorInfo info, Exception e, Diagnostic error) : this(info, ImmutableArray <GeneratedSourceText> .Empty, ImmutableArray <SyntaxTree> .Empty, ImmutableArray.Create(error), syntaxReceiver : null, exception : e) { }
internal override bool AcceptedBy(GeneratorInfo info) => info.EditCallback is object;
internal override bool TryApply(GeneratorInfo info, GeneratorEditContext context) => info.EditCallback !.Invoke(context, this);
internal abstract bool AcceptedBy(GeneratorInfo info);
internal abstract bool TryApply(GeneratorInfo info, GeneratorEditContext context);
public GeneratorState(GeneratorInfo info) : this(info, ImmutableDictionary <GeneratedSourceText, SyntaxTree> .Empty) { }
private GeneratorState(GeneratorInfo info, ImmutableDictionary <GeneratedSourceText, SyntaxTree> sources) { this.Sources = sources; this.Info = info; }
/// <summary> /// Creates a generator state that contains results /// </summary> public GeneratorState(GeneratorInfo info, ImmutableArray <GeneratedSyntaxTree> postInitTrees, ImmutableArray <ISyntaxInputNode> inputNodes, ImmutableArray <IIncrementalGeneratorOutputNode> outputNodes, ImmutableArray <GeneratedSyntaxTree> generatedTrees, ImmutableArray <Diagnostic> diagnostics, TimeSpan elapsedTime) : this(info, postInitTrees, inputNodes, outputNodes, generatedTrees, diagnostics, exception : null, elapsedTime) { }
/// <summary> /// Creates a generator state that contains results /// </summary> public GeneratorState(GeneratorInfo info, ImmutableArray <GeneratedSyntaxTree> postInitTrees, ImmutableArray <GeneratedSyntaxTree> generatedTrees, ImmutableArray <Diagnostic> diagnostics) : this(info, postInitTrees, generatedTrees, diagnostics, syntaxReceiver : null, exception : null) { }
/// <summary> /// Creates a new generator state that contains an exception and the associated diagnostic /// </summary> public GeneratorState(GeneratorInfo info, Exception e, Diagnostic error, TimeSpan elapsedTime) : this(info, ImmutableArray <GeneratedSyntaxTree> .Empty, ImmutableArray <ISyntaxInputNode> .Empty, ImmutableArray <IIncrementalGeneratorOutputNode> .Empty, ImmutableArray <GeneratedSyntaxTree> .Empty, ImmutableArray.Create(error), exception : e, elapsedTime) { }
/// <summary> /// Creates a new generator state that contains information, constant trees and an execution pipeline /// </summary> public GeneratorState(GeneratorInfo info, ImmutableArray <GeneratedSyntaxTree> postInitTrees, ImmutableArray <ISyntaxInputNode> inputNodes, ImmutableArray <IIncrementalGeneratorOutputNode> outputNodes) : this(info, postInitTrees, inputNodes, outputNodes, ImmutableArray <GeneratedSyntaxTree> .Empty, ImmutableArray <Diagnostic> .Empty, exception : null, elapsedTime : TimeSpan.Zero) { }
/// <summary> /// Creates a new generator state that contains information and constant trees /// </summary> public GeneratorState(GeneratorInfo info, ImmutableArray <GeneratedSyntaxTree> postInitTrees) : this(info, postInitTrees, ImmutableArray <ISyntaxInputNode> .Empty, ImmutableArray <IIncrementalGeneratorOutputNode> .Empty) { }
/// <summary> /// Creates a new generator state that just contains information /// </summary> public GeneratorState(GeneratorInfo info) : this(info, ImmutableArray <GeneratedSyntaxTree> .Empty) { }
/// <summary> /// Creates a generator state that contains results /// </summary> public GeneratorState(GeneratorInfo info, ImmutableArray <GeneratedSourceText> sourceTexts, ImmutableArray <SyntaxTree> trees, ImmutableArray <Diagnostic> diagnostics) : this(info, sourceTexts, trees, diagnostics, syntaxReceiver : null, exception : null) { }