-
Notifications
You must be signed in to change notification settings - Fork 4k
/
IIncrementalGeneratorOutputNode.cs
53 lines (46 loc) · 2.42 KB
/
IIncrementalGeneratorOutputNode.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
namespace Microsoft.CodeAnalysis
{
/// <summary>
/// Internal representation of an incremental output
/// </summary>
internal interface IIncrementalGeneratorOutputNode
{
IncrementalGeneratorOutputKind Kind { get; }
void AppendOutputs(IncrementalExecutionContext context, CancellationToken cancellationToken);
}
/// <summary>
/// Represents the various output kinds of an <see cref="IIncrementalGenerator"/>.
/// </summary>
/// <remarks>
/// Can be passed as a bit field when creating a <see cref="GeneratorDriver"/> to selectively disable outputs.
/// </remarks>
[Flags]
public enum IncrementalGeneratorOutputKind
{
/// <summary>
/// Represents no output kinds. Can be used when creating a driver to indicate that no outputs should be disabled.
/// </summary>
None = 0,
/// <summary>
/// A regular source output, registered via <see cref="IncrementalGeneratorInitializationContext.RegisterSourceOutput{TSource}(IncrementalValueProvider{TSource}, Action{SourceProductionContext, TSource})"/>
/// or <see cref="IncrementalGeneratorInitializationContext.RegisterSourceOutput{TSource}(IncrementalValuesProvider{TSource}, Action{SourceProductionContext, TSource})"/>
/// </summary>
Source = 0b1,
/// <summary>
/// A post-initialization output, which will be visible to later phases, registered via <see cref="IncrementalGeneratorInitializationContext.RegisterPostInitializationOutput(Action{IncrementalGeneratorPostInitializationContext})"/>
/// </summary>
PostInit = 0b10,
/// <summary>
/// An Implementation only source output, registered via <see cref="IncrementalGeneratorInitializationContext.RegisterImplementationSourceOutput{TSource}(IncrementalValueProvider{TSource}, Action{SourceProductionContext, TSource})"/>
/// or <see cref="IncrementalGeneratorInitializationContext.RegisterImplementationSourceOutput{TSource}(IncrementalValuesProvider{TSource}, Action{SourceProductionContext, TSource})"/>
/// </summary>
Implementation = 0b100
}
}