18 implementations of ISourceGenerator
Microsoft.CodeAnalysis (1)
SourceGeneration\IncrementalWrapper.cs (1)
19
internal sealed class IncrementalGeneratorWrapper :
ISourceGenerator
Microsoft.CodeAnalysis.TestAnalyzerReference (1)
HelloWorldGenerator.cs (1)
13
public sealed class HelloWorldGenerator :
ISourceGenerator
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333
private sealed class Generator :
ISourceGenerator
Microsoft.Gen.ComplianceReports (1)
ComplianceReportsGenerator.cs (1)
17
public sealed class ComplianceReportsGenerator :
ISourceGenerator
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333
private sealed class Generator :
ISourceGenerator
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333
private sealed class Generator :
ISourceGenerator
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333
private sealed class Generator :
ISourceGenerator
Microsoft.Gen.MetadataExtractor (3)
MetadataReportsGenerator.cs (1)
19
public sealed class MetadataReportsGenerator :
ISourceGenerator
src\Generators\Microsoft.Gen.ComplianceReports\ComplianceReportsGenerator.cs (1)
17
public sealed class ComplianceReportsGenerator :
ISourceGenerator
src\Generators\Microsoft.Gen.MetricsReports\MetricsReportsGenerator.cs (1)
14
public class MetricsReportsGenerator :
ISourceGenerator
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333
private sealed class Generator :
ISourceGenerator
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333
private sealed class Generator :
ISourceGenerator
Microsoft.Gen.MetricsReports (1)
MetricsReportsGenerator.cs (1)
14
public class MetricsReportsGenerator :
ISourceGenerator
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333
private sealed class Generator :
ISourceGenerator
Microsoft.ML.AutoML.SourceGenerator (4)
EstimatorTypeGenerator.cs (1)
18
public sealed class EstimatorTypeGenerator :
ISourceGenerator
SearchSpaceGenerator.cs (1)
18
public sealed class SearchSpaceGenerator :
ISourceGenerator
SweepableEstimatorFactoryGenerator.cs (1)
16
public sealed class SweepableEstimatorFactoryGenerator :
ISourceGenerator
SweepableEstimatorGenerator.cs (1)
15
public sealed class SweepableEstimatorGenerator :
ISourceGenerator
147 references to ISourceGenerator
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
175
ISourceGenerator
generator,
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
175
ISourceGenerator
generator,
Microsoft.CodeAnalysis (85)
CommandLine\CommandLineArguments.cs (2)
489
out ImmutableArray<
ISourceGenerator
> generators)
492
var generatorBuilder = ImmutableArray.CreateBuilder<
ISourceGenerator
>();
CommandLine\CommonCompiler.cs (8)
124
out ImmutableArray<
ISourceGenerator
> generators);
814
ImmutableArray<
ISourceGenerator
> generators,
863
foreach (
var
generator in generators)
874
private protected abstract GeneratorDriver CreateGeneratorDriver(string baseDirectory, ParseOptions parseOptions, ImmutableArray<
ISourceGenerator
> generators, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider, ImmutableArray<AdditionalText> additionalTexts, SourceHashAlgorithm checksumAlgorithm);
1114
ImmutableArray<
ISourceGenerator
> generators,
1778
ImmutableArray<
ISourceGenerator
> generators,
1809
ImmutableArray<
ISourceGenerator
> generators,
1821
ImmutableArray<
ISourceGenerator
> generators,
Compilation\Compilation.cs (2)
203
ImmutableArray<
ISourceGenerator
> generators = default,
228
ImmutableArray<
ISourceGenerator
> generators = default,
Compilation\DeterministicKey.cs (1)
58
ImmutableArray<
ISourceGenerator
> generators = default,
Compilation\DeterministicKeyBuilder.cs (2)
128
ImmutableArray<
ISourceGenerator
> generators,
207
foreach (
var
generator in generators)
DiagnosticAnalyzer\AnalyzerFileReference.cs (7)
40
private readonly Extensions<
ISourceGenerator
> _generators;
124
public override ImmutableArray<
ISourceGenerator
> GetGeneratorsForAllLanguages()
130
public override ImmutableArray<
ISourceGenerator
> GetGenerators()
135
public override ImmutableArray<
ISourceGenerator
> GetGenerators(string language)
196
/// Adds the <see cref="ImmutableArray{T}"/> of <see cref="
ISourceGenerator
"/> defined in this assembly reference of given <paramref name="language"/>.
198
internal void AddGenerators(ImmutableArray<
ISourceGenerator
>.Builder builder, string language)
344
private static
ISourceGenerator
? CoerceGeneratorType(object? generator)
DiagnosticAnalyzer\AnalyzerReference.cs (6)
67
public virtual ImmutableArray<
ISourceGenerator
> GetGeneratorsForAllLanguages() => ImmutableArray<
ISourceGenerator
>.Empty;
70
public virtual ImmutableArray<
ISourceGenerator
> GetGenerators() => ImmutableArray<
ISourceGenerator
>.Empty;
76
public virtual ImmutableArray<
ISourceGenerator
> GetGenerators(string language) => ImmutableArray<
ISourceGenerator
>.Empty;
SourceGeneration\GeneratedSourceText.cs (1)
12
/// A source text created by an <see cref="
ISourceGenerator
"/>
SourceGeneration\GeneratedSyntaxTree.cs (1)
10
/// A syntax tree created by a <see cref="
ISourceGenerator
"/>
SourceGeneration\GeneratorAdaptor.cs (2)
26
internal
ISourceGenerator
SourceGenerator { get; }
28
public SourceGeneratorAdaptor(
ISourceGenerator
generator, string sourceExtension)
SourceGeneration\GeneratorContexts.cs (5)
16
/// Context passed to a source generator when <see cref="
ISourceGenerator
.Execute(GeneratorExecutionContext)"/> is called
131
/// Context passed to a source generator when <see cref="
ISourceGenerator
.Initialize(GeneratorInitializationContext)"/> is called
156
/// During <see cref="
ISourceGenerator
.Execute(GeneratorExecutionContext)"/> the generator can obtain the <see cref="ISyntaxReceiver"/> instance that was
178
/// During <see cref="
ISourceGenerator
.Execute(GeneratorExecutionContext)"/> the generator can obtain the <see cref="ISyntaxContextReceiver"/> instance that was
182
/// A new instance of <see cref="ISyntaxContextReceiver"/> is created prior to every call to <see cref="
ISourceGenerator
.Execute(GeneratorExecutionContext)"/>,
SourceGeneration\GeneratorDriver.cs (14)
37
internal GeneratorDriver(ParseOptions parseOptions, ImmutableArray<
ISourceGenerator
> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, GeneratorDriverOptions driverOptions)
96
public GeneratorDriver AddGenerators(ImmutableArray<
ISourceGenerator
> generators)
105
public GeneratorDriver ReplaceGenerators(ImmutableArray<
ISourceGenerator
> generators)
110
foreach (
var
generator in generators)
127
public GeneratorDriver RemoveGenerators(ImmutableArray<
ISourceGenerator
> generators)
256
var
sourceGenerator = state.Generators[i];
448
static bool handleGeneratorException(Compilation compilation, CommonMessageProvider messageProvider,
ISourceGenerator
sourceGenerator, Exception e, bool isInit)
460
bool shouldSkipGenerator(
ISourceGenerator
generator) => generatorFilter?.Invoke(new GeneratorFilterContext(generator, cancellationToken)) == false;
510
private ImmutableArray<GeneratedSyntaxTree> ParseAdditionalSources(
ISourceGenerator
generator, ImmutableArray<GeneratedSourceText> generatedSources, CancellationToken cancellationToken)
546
private ImmutableArray<GeneratedSyntaxTree> ReuseOrParsePreCompilationSources(
ISourceGenerator
generator, ImmutableArray<GeneratedSourceText> sources, ImmutableArray<GeneratedSyntaxTree> previousTrees, CancellationToken cancellationToken)
578
private static GeneratorState SetGeneratorException(Compilation compilation, CommonMessageProvider provider, GeneratorState generatorState,
ISourceGenerator
generator, Exception e, DiagnosticBag? diagnosticBag, GeneratorRunPhase phase, TimeSpan? runTime, CancellationToken cancellationToken)
603
private static Diagnostic CreateGeneratorExceptionDiagnostic(CommonMessageProvider provider,
ISourceGenerator
generator, Exception e, bool isInit)
662
internal static string GetFilePathPrefixForGenerator(string? baseDirectory,
ISourceGenerator
generator)
668
private static ImmutableArray<IIncrementalGenerator> GetIncrementalGenerators(ImmutableArray<
ISourceGenerator
> generators, string sourceExtension)
SourceGeneration\GeneratorDriverState.cs (5)
17
ImmutableArray<
ISourceGenerator
> sourceGenerators,
45
/// The set of <see cref="
ISourceGenerator
"/>s associated with this state.
51
internal readonly ImmutableArray<
ISourceGenerator
> Generators;
58
/// where each entry is either the unwrapped incremental generator or a wrapped <see cref="
ISourceGenerator
"/>
116
ImmutableArray<
ISourceGenerator
>? sourceGenerators = null,
SourceGeneration\GeneratorExtensions.cs (7)
18
/// <see cref="
ISourceGenerator
"/>. This method will unwrap and return the underlying type
23
public static Type GetGeneratorType(this
ISourceGenerator
generator)
47
/// Converts an <see cref="IIncrementalGenerator"/> into an <see cref="
ISourceGenerator
"/> object that can be used when constructing a <see cref="GeneratorDriver"/>
50
/// <returns>An <see cref="
ISourceGenerator
"/> that can be passed to a generator driver</returns>
51
public static
ISourceGenerator
AsSourceGenerator(this IIncrementalGenerator incrementalGenerator) => incrementalGenerator switch
58
/// Converts an <see cref="
ISourceGenerator
"/> into an <see cref="IIncrementalGenerator"/>
62
public static IIncrementalGenerator AsIncrementalGenerator(this
ISourceGenerator
sourceGenerator) => sourceGenerator switch
SourceGeneration\GeneratorTimerExtensions.cs (1)
30
public static RunTimer CreateSingleGeneratorRunTimer(this CodeAnalysisEventSource eventSource,
ISourceGenerator
generator, Func<TimeSpan, TimeSpan> adjustRunTime)
SourceGeneration\IncrementalContexts.cs (2)
369
internal GeneratorFilterContext(
ISourceGenerator
generator, CancellationToken cancellationToken)
378
public
ISourceGenerator
Generator { get; }
SourceGeneration\IncrementalWrapper.cs (3)
13
/// Wraps an incremental generator in a dummy <see cref="
ISourceGenerator
"/> interface.
29
void
ISourceGenerator
.Execute(GeneratorExecutionContext context) => throw ExceptionUtilities.Unreachable();
31
void
ISourceGenerator
.Initialize(GeneratorInitializationContext context) => throw ExceptionUtilities.Unreachable();
SourceGeneration\ISyntaxReceiver.cs (6)
11
/// A <see cref="
ISourceGenerator
"/> can provide an instance of <see cref="ISyntaxReceiver"/>
19
/// <see cref="
ISourceGenerator
.Execute(GeneratorExecutionContext)"/> the generator can obtain the
26
/// An <see cref="
ISourceGenerator
"/> may provide only a single <see cref="ISyntaxReceiver"/> or
50
/// A <see cref="
ISourceGenerator
"/> can provide an instance of <see cref="ISyntaxContextReceiver"/>
59
/// During <see cref="
ISourceGenerator
.Execute(GeneratorExecutionContext)"/> the generator can obtain the
66
/// An <see cref="
ISourceGenerator
"/> may provide only a single <see cref="ISyntaxReceiver"/> or
SourceGeneration\RunResults.cs (10)
15
/// Represents the results of running a generation pass over a set of <see cref="
ISourceGenerator
"/>s.
30
/// The individual result of each <see cref="
ISourceGenerator
"/> that was run in this generator pass, one per generator.
77
/// Represents the results of a single <see cref="
ISourceGenerator
"/> generation pass.
82
ISourceGenerator
generator,
106
/// The <see cref="
ISourceGenerator
"/> that produced this result.
108
public
ISourceGenerator
Generator { get; }
166
/// Represents the results of an <see cref="
ISourceGenerator
"/> calling <see cref="GeneratorExecutionContext.AddSource(string, SourceText)"/>.
226
internal GeneratorTimingInfo(
ISourceGenerator
generator, TimeSpan elapsedTime)
233
/// The <see cref="
ISourceGenerator
"/> that was running during the recorded time.
235
public
ISourceGenerator
Generator { get; }
Microsoft.CodeAnalysis.CSharp (8)
CommandLine\CSharpCompiler.cs (2)
339
out ImmutableArray<
ISourceGenerator
> generators)
376
private protected override GeneratorDriver CreateGeneratorDriver(string baseDirectory, ParseOptions parseOptions, ImmutableArray<
ISourceGenerator
> generators, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider, ImmutableArray<AdditionalText> additionalTexts, SourceHashAlgorithm checksumAlgorithm)
SourceGeneration\CSharpGeneratorDriver.cs (6)
27
internal CSharpGeneratorDriver(CSharpParseOptions parseOptions, ImmutableArray<
ISourceGenerator
> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, GeneratorDriverOptions driverOptions)
38
/// Creates a new instance of <see cref="CSharpGeneratorDriver"/> with the specified <see cref="
ISourceGenerator
"/>s and default options
42
public static CSharpGeneratorDriver Create(params
ISourceGenerator
[] generators)
54
/// Creates a new instance of <see cref="CSharpGeneratorDriver"/> with the specified <see cref="
ISourceGenerator
"/>s and the provided options or default.
62
public static CSharpGeneratorDriver Create(IEnumerable<
ISourceGenerator
> generators, IEnumerable<AdditionalText>? additionalTexts = null, CSharpParseOptions? parseOptions = null, AnalyzerConfigOptionsProvider? optionsProvider = null, GeneratorDriverOptions driverOptions = default)
67
public static CSharpGeneratorDriver Create(IEnumerable<
ISourceGenerator
> generators, IEnumerable<AdditionalText>? additionalTexts, CSharpParseOptions? parseOptions, AnalyzerConfigOptionsProvider? optionsProvider)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Workspace\LanguageServices\CSharpCompilationFactoryService.cs (1)
56
GeneratorDriver ICompilationFactoryService.CreateGeneratorDriver(ParseOptions parseOptions, ImmutableArray<
ISourceGenerator
> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, string? generatedFilesBaseDirectory)
Microsoft.CodeAnalysis.Workspaces (31)
SourceGeneration\SourceGeneratorExtensions.cs (2)
22
public static bool IsRequiredGenerator(this
ISourceGenerator
generator)
34
public static SourceGeneratorPresence GetSourceGeneratorPresence(this ImmutableArray<
ISourceGenerator
> generators)
SourceGeneratorTelemetry\ISourceGeneratorTelemetryCollectorWorkspaceService.cs (1)
14
void CollectRunResult(GeneratorDriverRunResult driverRunResult, GeneratorDriverTimingInfo driverTimingInfo, Func<
ISourceGenerator
, AnalyzerReference> getAnalyzerReference);
SourceGeneratorTelemetry\SourceGeneratorTelemetryCollectorWorkspaceService.cs (5)
22
public GeneratorTelemetryKey(
ISourceGenerator
generator, AnalyzerReference analyzerReference)
41
private readonly ConditionalWeakTable<
ISourceGenerator
, GeneratorTelemetryKey> _generatorTelemetryKeys = new();
46
private GeneratorTelemetryKey GetTelemetryKey(
ISourceGenerator
generator, Func<
ISourceGenerator
, AnalyzerReference> getAnalyzerReference)
52
Func<
ISourceGenerator
, AnalyzerReference> getAnalyzerReference)
Workspace\Host\CompilationFactory\ICompilationFactoryService.cs (1)
18
GeneratorDriver CreateGeneratorDriver(ParseOptions parseOptions, ImmutableArray<
ISourceGenerator
> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, string? generatedFilesBaseDirectory);
Workspace\Host\Metadata\IAnalyzerAssemblyLoaderProvider.cs (1)
26
/// cref="
ISourceGenerator
"/>s in a fresh <see cref="AssemblyLoadContext"/>.
Workspace\IsolatedAnalyzerFileReference.cs (8)
28
/// then ensures that as long as it is alive (or any <see cref="DiagnosticAnalyzer"/> or <see cref="
ISourceGenerator
"/>
39
/// cref="
ISourceGenerator
"/> is alive, that the corresponding <see cref="IsolatedAnalyzerReferenceSet"/> (and its
45
private static readonly ConditionalWeakTable<
ISourceGenerator
, IsolatedAnalyzerReferenceSet> s_generatorToPinnedReferenceSet = [];
69
public override ImmutableArray<
ISourceGenerator
> GetGenerators()
72
public override ImmutableArray<
ISourceGenerator
> GetGenerators(string language)
75
public override ImmutableArray<
ISourceGenerator
> GetGeneratorsForAllLanguages()
81
private ImmutableArray<
ISourceGenerator
> PinGenerators<TArg>(Func<AnalyzerReference, TArg, ImmutableArray<
ISourceGenerator
>> getItems, TArg arg)
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (8)
30
ImmutableArray<
ISourceGenerator
> SourceGenerators,
31
FrozenDictionary<
ISourceGenerator
, AnalyzerReference> SourceGeneratorToAnalyzerReference);
36
/// cref="
ISourceGenerator
"/>s produced by those references. This should only be created and cached on the OOP side
57
private static ImmutableArray<
ISourceGenerator
> GetSourceGenerators(ProjectState projectState)
75
private static AnalyzerReference GetAnalyzerReference(ProjectState projectState,
ISourceGenerator
sourceGenerator)
98
using var generators = TemporaryArray<
ISourceGenerator
>.Empty;
99
using var _ = PooledDictionary<
ISourceGenerator
, AnalyzerReference>.GetInstance(out var generatorToAnalyzerReference);
103
foreach (
var
generator in reference.GetGenerators(projectState.Language).Distinct())
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
428
ISourceGenerator
generator,
Workspace\Solution\SourceGeneratedDocument.cs (1)
12
/// A <see cref="Document"/> that was generated by an <see cref="
ISourceGenerator
" />.
Workspace\Solution\SourceGeneratedDocumentIdentity.cs (1)
36
public static SourceGeneratedDocumentIdentity Generate(ProjectId projectId, string hintName,
ISourceGenerator
generator, string filePath, AnalyzerReference analyzerReference)
Workspace\Solution\SourceGeneratorIdentity.cs (2)
29
public static SourceGeneratorIdentity Create(
ISourceGenerator
generator, AnalyzerReference analyzerReference)
42
foreach (
var
generator in analyzerReference.GetGenerators(language))
Microsoft.Gen.BuildMetadata.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245
ISourceGenerator
generator,
259
ISourceGenerator
generator,
Microsoft.Gen.ComplianceReports.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245
ISourceGenerator
generator,
259
ISourceGenerator
generator,
Microsoft.Gen.ContextualOptions.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245
ISourceGenerator
generator,
259
ISourceGenerator
generator,
Microsoft.Gen.Logging.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245
ISourceGenerator
generator,
259
ISourceGenerator
generator,
Microsoft.Gen.MetadataExtractor.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245
ISourceGenerator
generator,
259
ISourceGenerator
generator,
Microsoft.Gen.Metrics.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245
ISourceGenerator
generator,
259
ISourceGenerator
generator,
Microsoft.Gen.MetricsReports.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245
ISourceGenerator
generator,
259
ISourceGenerator
generator,
rzc (1)
RazorSourceGeneratorHost.cs (1)
112
var
generator = new RazorSourceGenerator().AsSourceGenerator();
VBCSCompiler (5)
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCacheUtilities.cs (1)
32
ImmutableArray<
ISourceGenerator
> generators,
src\roslyn\src\Compilers\Server\VBCSCompiler\CSharpCompilerServer.cs (2)
44
ImmutableArray<
ISourceGenerator
> generators,
67
ImmutableArray<
ISourceGenerator
> generators,
src\roslyn\src\Compilers\Server\VBCSCompiler\VisualBasicCompilerServer.cs (2)
44
ImmutableArray<
ISourceGenerator
> generators,
67
ImmutableArray<
ISourceGenerator
> generators,