Partager via


CSharpGeneratorDriver.Create Method

Definition

Overloads

Create(IIncrementalGenerator[])

Creates a new instance of CSharpGeneratorDriver with the specified IIncrementalGenerators and default options

Create(ISourceGenerator[])

Creates a new instance of CSharpGeneratorDriver with the specified ISourceGenerators and default options

Create(IEnumerable<ISourceGenerator>, IEnumerable<AdditionalText>, CSharpParseOptions, AnalyzerConfigOptionsProvider)

Creates a new instance of CSharpGeneratorDriver with the specified ISourceGenerators and the provided options or default.

Create(IEnumerable<ISourceGenerator>, IEnumerable<AdditionalText>, CSharpParseOptions, AnalyzerConfigOptionsProvider, GeneratorDriverOptions)

Creates a new instance of CSharpGeneratorDriver with the specified ISourceGenerators and the provided options or default.

Create(IIncrementalGenerator[])

Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs

Creates a new instance of CSharpGeneratorDriver with the specified IIncrementalGenerators and default options

public static Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver Create (params Microsoft.CodeAnalysis.IIncrementalGenerator[] incrementalGenerators);
static member Create : Microsoft.CodeAnalysis.IIncrementalGenerator[] -> Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver
Public Shared Function Create (ParamArray incrementalGenerators As IIncrementalGenerator()) As CSharpGeneratorDriver

Parameters

incrementalGenerators
IIncrementalGenerator[]

The incremental generators to create this driver with

Returns

A new CSharpGeneratorDriver instance.

Applies to

Create(ISourceGenerator[])

Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs

Creates a new instance of CSharpGeneratorDriver with the specified ISourceGenerators and default options

public static Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver Create (params Microsoft.CodeAnalysis.ISourceGenerator[] generators);
static member Create : Microsoft.CodeAnalysis.ISourceGenerator[] -> Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver
Public Shared Function Create (ParamArray generators As ISourceGenerator()) As CSharpGeneratorDriver

Parameters

generators
ISourceGenerator[]

The generators to create this driver with

Returns

A new CSharpGeneratorDriver instance.

Applies to

Create(IEnumerable<ISourceGenerator>, IEnumerable<AdditionalText>, CSharpParseOptions, AnalyzerConfigOptionsProvider)

Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs

Creates a new instance of CSharpGeneratorDriver with the specified ISourceGenerators and the provided options or default.

public static Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver Create (System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ISourceGenerator> generators, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.AdditionalText>? additionalTexts = default, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? parseOptions = default, Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider? optionsProvider = default);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public static Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver Create (System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ISourceGenerator> generators, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.AdditionalText>? additionalTexts, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? parseOptions, Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider? optionsProvider);
static member Create : seq<Microsoft.CodeAnalysis.ISourceGenerator> * seq<Microsoft.CodeAnalysis.AdditionalText> * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions * Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider -> Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
static member Create : seq<Microsoft.CodeAnalysis.ISourceGenerator> * seq<Microsoft.CodeAnalysis.AdditionalText> * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions * Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider -> Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver
Public Shared Function Create (generators As IEnumerable(Of ISourceGenerator), Optional additionalTexts As IEnumerable(Of AdditionalText) = Nothing, Optional parseOptions As CSharpParseOptions = Nothing, Optional optionsProvider As AnalyzerConfigOptionsProvider = Nothing) As CSharpGeneratorDriver
Public Shared Function Create (generators As IEnumerable(Of ISourceGenerator), additionalTexts As IEnumerable(Of AdditionalText), parseOptions As CSharpParseOptions, optionsProvider As AnalyzerConfigOptionsProvider) As CSharpGeneratorDriver

Parameters

generators
IEnumerable<ISourceGenerator>

The generators to create this driver with

additionalTexts
IEnumerable<AdditionalText>

A list of AdditionalTexts available to generators in this driver, or null if there are none.

parseOptions
CSharpParseOptions

The CSharpParseOptions that should be used when parsing generated files, or null to use Default

optionsProvider
AnalyzerConfigOptionsProvider

An AnalyzerConfigOptionsProvider that can be used to retrieve analyzer config values by the generators in this driver, or null if there are none.

Returns

A new CSharpGeneratorDriver instance.

Attributes

Applies to

Create(IEnumerable<ISourceGenerator>, IEnumerable<AdditionalText>, CSharpParseOptions, AnalyzerConfigOptionsProvider, GeneratorDriverOptions)

Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs
Source:
CSharpGeneratorDriver.cs

Creates a new instance of CSharpGeneratorDriver with the specified ISourceGenerators and the provided options or default.

public static Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver Create (System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.ISourceGenerator> generators, System.Collections.Generic.IEnumerable<Microsoft.CodeAnalysis.AdditionalText>? additionalTexts = default, Microsoft.CodeAnalysis.CSharp.CSharpParseOptions? parseOptions = default, Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider? optionsProvider = default, Microsoft.CodeAnalysis.GeneratorDriverOptions driverOptions = default);
static member Create : seq<Microsoft.CodeAnalysis.ISourceGenerator> * seq<Microsoft.CodeAnalysis.AdditionalText> * Microsoft.CodeAnalysis.CSharp.CSharpParseOptions * Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptionsProvider * Microsoft.CodeAnalysis.GeneratorDriverOptions -> Microsoft.CodeAnalysis.CSharp.CSharpGeneratorDriver
Public Shared Function Create (generators As IEnumerable(Of ISourceGenerator), Optional additionalTexts As IEnumerable(Of AdditionalText) = Nothing, Optional parseOptions As CSharpParseOptions = Nothing, Optional optionsProvider As AnalyzerConfigOptionsProvider = Nothing, Optional driverOptions As GeneratorDriverOptions = Nothing) As CSharpGeneratorDriver

Parameters

generators
IEnumerable<ISourceGenerator>

The generators to create this driver with

additionalTexts
IEnumerable<AdditionalText>

A list of AdditionalTexts available to generators in this driver, or null if there are none.

parseOptions
CSharpParseOptions

The CSharpParseOptions that should be used when parsing generated files, or null to use Default

optionsProvider
AnalyzerConfigOptionsProvider

An AnalyzerConfigOptionsProvider that can be used to retrieve analyzer config values by the generators in this driver, or null if there are none.

driverOptions
GeneratorDriverOptions

A GeneratorDriverOptions that controls the behavior of the created driver.

Returns

A new CSharpGeneratorDriver instance.

Applies to