18 implementations of ISourceGenerator
Microsoft.CodeAnalysis (1)
SourceGeneration\IncrementalWrapper.cs (1)
19internal sealed class IncrementalGeneratorWrapper : ISourceGenerator
Microsoft.CodeAnalysis.TestAnalyzerReference (1)
HelloWorldGenerator.cs (1)
13public sealed class HelloWorldGenerator : ISourceGenerator
Microsoft.Gen.BuildMetadata.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333private sealed class Generator : ISourceGenerator
Microsoft.Gen.ComplianceReports (1)
ComplianceReportsGenerator.cs (1)
17public sealed class ComplianceReportsGenerator : ISourceGenerator
Microsoft.Gen.ComplianceReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333private sealed class Generator : ISourceGenerator
Microsoft.Gen.ContextualOptions.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333private sealed class Generator : ISourceGenerator
Microsoft.Gen.Logging.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333private sealed class Generator : ISourceGenerator
Microsoft.Gen.MetadataExtractor (3)
MetadataReportsGenerator.cs (1)
19public sealed class MetadataReportsGenerator : ISourceGenerator
src\Generators\Microsoft.Gen.ComplianceReports\ComplianceReportsGenerator.cs (1)
17public sealed class ComplianceReportsGenerator : ISourceGenerator
src\Generators\Microsoft.Gen.MetricsReports\MetricsReportsGenerator.cs (1)
14public class MetricsReportsGenerator : ISourceGenerator
Microsoft.Gen.MetadataExtractor.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333private sealed class Generator : ISourceGenerator
Microsoft.Gen.Metrics.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333private sealed class Generator : ISourceGenerator
Microsoft.Gen.MetricsReports (1)
MetricsReportsGenerator.cs (1)
14public class MetricsReportsGenerator : ISourceGenerator
Microsoft.Gen.MetricsReports.Unit.Tests (1)
test\Generators\Shared\RoslynTestUtils.cs (1)
333private sealed class Generator : ISourceGenerator
Microsoft.ML.AutoML.SourceGenerator (4)
EstimatorTypeGenerator.cs (1)
18public sealed class EstimatorTypeGenerator : ISourceGenerator
SearchSpaceGenerator.cs (1)
18public sealed class SearchSpaceGenerator : ISourceGenerator
SweepableEstimatorFactoryGenerator.cs (1)
16public sealed class SweepableEstimatorFactoryGenerator : ISourceGenerator
SweepableEstimatorGenerator.cs (1)
15public sealed class SweepableEstimatorGenerator : ISourceGenerator
152 references to ISourceGenerator
Microsoft.Analyzers.Extra.Tests (1)
Resources\RoslynTestUtils.cs (1)
175ISourceGenerator generator,
Microsoft.Analyzers.Local.Tests (1)
Resources\RoslynTestUtils.cs (1)
175ISourceGenerator generator,
Microsoft.CodeAnalysis (85)
CommandLine\CommandLineArguments.cs (2)
489out ImmutableArray<ISourceGenerator> generators) 492var generatorBuilder = ImmutableArray.CreateBuilder<ISourceGenerator>();
CommandLine\CommonCompiler.cs (8)
123out ImmutableArray<ISourceGenerator> generators); 806ImmutableArray<ISourceGenerator> generators, 855foreach (var generator in generators) 866private protected abstract GeneratorDriver CreateGeneratorDriver(string baseDirectory, ParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider, ImmutableArray<AdditionalText> additionalTexts, SourceHashAlgorithm checksumAlgorithm); 1103ImmutableArray<ISourceGenerator> generators, 1766ImmutableArray<ISourceGenerator> generators, 1783ImmutableArray<ISourceGenerator> generators, 1795ImmutableArray<ISourceGenerator> generators,
Compilation\Compilation.cs (2)
203ImmutableArray<ISourceGenerator> generators = default, 228ImmutableArray<ISourceGenerator> generators = default,
Compilation\DeterministicKey.cs (1)
58ImmutableArray<ISourceGenerator> generators = default,
Compilation\DeterministicKeyBuilder.cs (2)
128ImmutableArray<ISourceGenerator> generators, 196foreach (var generator in generators)
DiagnosticAnalyzer\AnalyzerFileReference.cs (7)
40private readonly Extensions<ISourceGenerator> _generators; 124public override ImmutableArray<ISourceGenerator> GetGeneratorsForAllLanguages() 130public override ImmutableArray<ISourceGenerator> GetGenerators() 135public 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"/>. 198internal void AddGenerators(ImmutableArray<ISourceGenerator>.Builder builder, string language) 344private static ISourceGenerator? CoerceGeneratorType(object? generator)
DiagnosticAnalyzer\AnalyzerReference.cs (6)
67public virtual ImmutableArray<ISourceGenerator> GetGeneratorsForAllLanguages() => ImmutableArray<ISourceGenerator>.Empty; 70public virtual ImmutableArray<ISourceGenerator> GetGenerators() => ImmutableArray<ISourceGenerator>.Empty; 76public 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)
26internal ISourceGenerator SourceGenerator { get; } 28public 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)
37internal GeneratorDriver(ParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, GeneratorDriverOptions driverOptions) 96public GeneratorDriver AddGenerators(ImmutableArray<ISourceGenerator> generators) 105public GeneratorDriver ReplaceGenerators(ImmutableArray<ISourceGenerator> generators) 110foreach (var generator in generators) 127public GeneratorDriver RemoveGenerators(ImmutableArray<ISourceGenerator> generators) 256var sourceGenerator = state.Generators[i]; 448static bool handleGeneratorException(Compilation compilation, CommonMessageProvider messageProvider, ISourceGenerator sourceGenerator, Exception e, bool isInit) 460bool shouldSkipGenerator(ISourceGenerator generator) => generatorFilter?.Invoke(new GeneratorFilterContext(generator, cancellationToken)) == false; 510private ImmutableArray<GeneratedSyntaxTree> ParseAdditionalSources(ISourceGenerator generator, ImmutableArray<GeneratedSourceText> generatedSources, CancellationToken cancellationToken) 546private ImmutableArray<GeneratedSyntaxTree> ReuseOrParsePreCompilationSources(ISourceGenerator generator, ImmutableArray<GeneratedSourceText> sources, ImmutableArray<GeneratedSyntaxTree> previousTrees, CancellationToken cancellationToken) 578private static GeneratorState SetGeneratorException(Compilation compilation, CommonMessageProvider provider, GeneratorState generatorState, ISourceGenerator generator, Exception e, DiagnosticBag? diagnosticBag, GeneratorRunPhase phase, TimeSpan? runTime, CancellationToken cancellationToken) 603private static Diagnostic CreateGeneratorExceptionDiagnostic(CommonMessageProvider provider, ISourceGenerator generator, Exception e, bool isInit) 662internal static string GetFilePathPrefixForGenerator(string? baseDirectory, ISourceGenerator generator) 668private static ImmutableArray<IIncrementalGenerator> GetIncrementalGenerators(ImmutableArray<ISourceGenerator> generators, string sourceExtension)
SourceGeneration\GeneratorDriverState.cs (5)
17ImmutableArray<ISourceGenerator> sourceGenerators, 45/// The set of <see cref="ISourceGenerator"/>s associated with this state. 51internal readonly ImmutableArray<ISourceGenerator> Generators; 58/// where each entry is either the unwrapped incremental generator or a wrapped <see cref="ISourceGenerator"/> 116ImmutableArray<ISourceGenerator>? sourceGenerators = null,
SourceGeneration\GeneratorExtensions.cs (7)
18/// <see cref="ISourceGenerator"/>. This method will unwrap and return the underlying type 23public 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> 51public static ISourceGenerator AsSourceGenerator(this IIncrementalGenerator incrementalGenerator) => incrementalGenerator switch 58/// Converts an <see cref="ISourceGenerator"/> into an <see cref="IIncrementalGenerator"/> 62public static IIncrementalGenerator AsIncrementalGenerator(this ISourceGenerator sourceGenerator) => sourceGenerator switch
SourceGeneration\GeneratorTimerExtensions.cs (1)
30public static RunTimer CreateSingleGeneratorRunTimer(this CodeAnalysisEventSource eventSource, ISourceGenerator generator, Func<TimeSpan, TimeSpan> adjustRunTime)
SourceGeneration\IncrementalContexts.cs (2)
369internal GeneratorFilterContext(ISourceGenerator generator, CancellationToken cancellationToken) 378public ISourceGenerator Generator { get; }
SourceGeneration\IncrementalWrapper.cs (3)
13/// Wraps an incremental generator in a dummy <see cref="ISourceGenerator"/> interface. 29void ISourceGenerator.Execute(GeneratorExecutionContext context) => throw ExceptionUtilities.Unreachable(); 31void 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. 82ISourceGenerator generator, 106/// The <see cref="ISourceGenerator"/> that produced this result. 108public ISourceGenerator Generator { get; } 166/// Represents the results of an <see cref="ISourceGenerator"/> calling <see cref="GeneratorExecutionContext.AddSource(string, SourceText)"/>. 226internal GeneratorTimingInfo(ISourceGenerator generator, TimeSpan elapsedTime) 233/// The <see cref="ISourceGenerator"/> that was running during the recorded time. 235public ISourceGenerator Generator { get; }
Microsoft.CodeAnalysis.CSharp (8)
CommandLine\CSharpCompiler.cs (2)
339out ImmutableArray<ISourceGenerator> generators) 376private protected override GeneratorDriver CreateGeneratorDriver(string baseDirectory, ParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider analyzerConfigOptionsProvider, ImmutableArray<AdditionalText> additionalTexts, SourceHashAlgorithm checksumAlgorithm)
SourceGeneration\CSharpGeneratorDriver.cs (6)
27internal 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 42public 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. 62public static CSharpGeneratorDriver Create(IEnumerable<ISourceGenerator> generators, IEnumerable<AdditionalText>? additionalTexts = null, CSharpParseOptions? parseOptions = null, AnalyzerConfigOptionsProvider? optionsProvider = null, GeneratorDriverOptions driverOptions = default) 67public static CSharpGeneratorDriver Create(IEnumerable<ISourceGenerator> generators, IEnumerable<AdditionalText>? additionalTexts, CSharpParseOptions? parseOptions, AnalyzerConfigOptionsProvider? optionsProvider)
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Workspace\LanguageServices\CSharpCompilationFactoryService.cs (1)
56GeneratorDriver ICompilationFactoryService.CreateGeneratorDriver(ParseOptions parseOptions, ImmutableArray<ISourceGenerator> generators, AnalyzerConfigOptionsProvider optionsProvider, ImmutableArray<AdditionalText> additionalTexts, string? generatedFilesBaseDirectory)
Microsoft.CodeAnalysis.VisualBasic (5)
CommandLine\VisualBasicCompiler.vb (2)
263ByRef generators As ImmutableArray(Of ISourceGenerator)) 301Private Protected Overrides Function CreateGeneratorDriver(baseDirectory As String, parseOptions As ParseOptions, generators As ImmutableArray(Of ISourceGenerator), analyzerConfigOptionsProvider As AnalyzerConfigOptionsProvider, additionalTexts As ImmutableArray(Of AdditionalText), checksumAlgorithm As SourceHashAlgorithm) As GeneratorDriver
SourceGeneration\VisualBasicGeneratorDriver.vb (3)
22Friend Sub New(parseOptions As VisualBasicParseOptions, generators As ImmutableArray(Of ISourceGenerator), optionsProvider As AnalyzerConfigOptionsProvider, additionalTexts As ImmutableArray(Of AdditionalText), driverOptions As GeneratorDriverOptions) 40Public Shared Function Create(generators As ImmutableArray(Of ISourceGenerator), Optional additionalTexts As ImmutableArray(Of AdditionalText) = Nothing, Optional parseOptions As VisualBasicParseOptions = Nothing, Optional analyzerConfigOptionsProvider As AnalyzerConfigOptionsProvider = Nothing, Optional driverOptions As GeneratorDriverOptions = Nothing) As VisualBasicGeneratorDriver 46Public Shared Function Create(generators As ImmutableArray(Of ISourceGenerator), additionalTexts As ImmutableArray(Of AdditionalText), parseOptions As VisualBasicParseOptions, analyzerConfigOptionsProvider As AnalyzerConfigOptionsProvider) As VisualBasicGeneratorDriver
Microsoft.CodeAnalysis.VisualBasic.Workspaces (1)
Workspace\LanguageServices\VisualBasicCompilationFactoryService.vb (1)
65generators As ImmutableArray(Of ISourceGenerator),
Microsoft.CodeAnalysis.Workspaces (31)
SourceGeneration\SourceGeneratorExtensions.cs (2)
22public static bool IsRequiredGenerator(this ISourceGenerator generator) 34public static SourceGeneratorPresence GetSourceGeneratorPresence(this ImmutableArray<ISourceGenerator> generators)
SourceGeneratorTelemetry\ISourceGeneratorTelemetryCollectorWorkspaceService.cs (1)
14void CollectRunResult(GeneratorDriverRunResult driverRunResult, GeneratorDriverTimingInfo driverTimingInfo, Func<ISourceGenerator, AnalyzerReference> getAnalyzerReference);
SourceGeneratorTelemetry\SourceGeneratorTelemetryCollectorWorkspaceService.cs (5)
22public GeneratorTelemetryKey(ISourceGenerator generator, AnalyzerReference analyzerReference) 41private readonly ConditionalWeakTable<ISourceGenerator, GeneratorTelemetryKey> _generatorTelemetryKeys = new(); 46private GeneratorTelemetryKey GetTelemetryKey(ISourceGenerator generator, Func<ISourceGenerator, AnalyzerReference> getAnalyzerReference) 52Func<ISourceGenerator, AnalyzerReference> getAnalyzerReference)
Workspace\Host\CompilationFactory\ICompilationFactoryService.cs (1)
18GeneratorDriver 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 45private static readonly ConditionalWeakTable<ISourceGenerator, IsolatedAnalyzerReferenceSet> s_generatorToPinnedReferenceSet = []; 69public override ImmutableArray<ISourceGenerator> GetGenerators() 72public override ImmutableArray<ISourceGenerator> GetGenerators(string language) 75public override ImmutableArray<ISourceGenerator> GetGeneratorsForAllLanguages() 81private ImmutableArray<ISourceGenerator> PinGenerators<TArg>(Func<AnalyzerReference, TArg, ImmutableArray<ISourceGenerator>> getItems, TArg arg)
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker_Generators.cs (1)
428ISourceGenerator generator,
Workspace\Solution\SolutionCompilationState_SourceGenerators.cs (8)
30ImmutableArray<ISourceGenerator> SourceGenerators, 31FrozenDictionary<ISourceGenerator, AnalyzerReference> SourceGeneratorToAnalyzerReference); 36/// cref="ISourceGenerator"/>s produced by those references. This should only be created and cached on the OOP side 57private static ImmutableArray<ISourceGenerator> GetSourceGenerators(ProjectState projectState) 75private static AnalyzerReference GetAnalyzerReference(ProjectState projectState, ISourceGenerator sourceGenerator) 98using var generators = TemporaryArray<ISourceGenerator>.Empty; 99using var _ = PooledDictionary<ISourceGenerator, AnalyzerReference>.GetInstance(out var generatorToAnalyzerReference); 103foreach (var generator in reference.GetGenerators(projectState.Language).Distinct())
Workspace\Solution\SourceGeneratedDocument.cs (1)
12/// A <see cref="Document"/> that was generated by an <see cref="ISourceGenerator" />.
Workspace\Solution\SourceGeneratedDocumentIdentity.cs (1)
36public static SourceGeneratedDocumentIdentity Generate(ProjectId projectId, string hintName, ISourceGenerator generator, string filePath, AnalyzerReference analyzerReference)
Workspace\Solution\SourceGeneratorIdentity.cs (2)
29public static SourceGeneratorIdentity Create(ISourceGenerator generator, AnalyzerReference analyzerReference) 42foreach (var generator in analyzerReference.GetGenerators(language))
Microsoft.Gen.BuildMetadata.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245ISourceGenerator generator, 259ISourceGenerator generator,
Microsoft.Gen.ComplianceReports.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245ISourceGenerator generator, 259ISourceGenerator generator,
Microsoft.Gen.ContextualOptions.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245ISourceGenerator generator, 259ISourceGenerator generator,
Microsoft.Gen.Logging.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245ISourceGenerator generator, 259ISourceGenerator generator,
Microsoft.Gen.MetadataExtractor.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245ISourceGenerator generator, 259ISourceGenerator generator,
Microsoft.Gen.Metrics.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245ISourceGenerator generator, 259ISourceGenerator generator,
Microsoft.Gen.MetricsReports.Unit.Tests (2)
test\Generators\Shared\RoslynTestUtils.cs (2)
245ISourceGenerator generator, 259ISourceGenerator generator,
VBCSCompiler (5)
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCacheUtilities.cs (1)
33ImmutableArray<ISourceGenerator> generators,
src\roslyn\src\Compilers\Server\VBCSCompiler\CSharpCompilerServer.cs (2)
42ImmutableArray<ISourceGenerator> generators, 55ImmutableArray<ISourceGenerator> generators,
src\roslyn\src\Compilers\Server\VBCSCompiler\VisualBasicCompilerServer.cs (2)
42ImmutableArray<ISourceGenerator> generators, 55ImmutableArray<ISourceGenerator> generators,