DiagnosticAnalyzerExtensions.WithAnalyzers 方法

定义

重载

WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions)

返回具有附加诊断分析器的新编译。

WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, CompilationWithAnalyzersOptions)

返回具有附加诊断分析器的新编译。

WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions, CancellationToken)
已过时.

返回具有附加诊断分析器的新编译。

WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions)

Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs

返回具有附加诊断分析器的新编译。

public static Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers WithAnalyzers (this Microsoft.CodeAnalysis.Compilation compilation, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer> analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options = default);
static member WithAnalyzers : Microsoft.CodeAnalysis.Compilation * System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer> * Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers
<Extension()>
Public Function WithAnalyzers (compilation As Compilation, analyzers As ImmutableArray(Of DiagnosticAnalyzer), Optional options As AnalyzerOptions = Nothing) As CompilationWithAnalyzers

参数

compilation
Compilation

要向其添加分析器的编译。

analyzers
ImmutableArray<DiagnosticAnalyzer>

要包含在将来分析中的分析器集。

options
AnalyzerOptions

传递给分析器的选项。

返回

适用于

WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, CompilationWithAnalyzersOptions)

Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs

返回具有附加诊断分析器的新编译。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::CodeAnalysis::Diagnostics::CompilationWithAnalyzers ^ WithAnalyzers(Microsoft::CodeAnalysis::Compilation ^ compilation, System::Collections::Immutable::ImmutableArray<Microsoft::CodeAnalysis::Diagnostics::DiagnosticAnalyzer ^> analyzers, Microsoft::CodeAnalysis::Diagnostics::CompilationWithAnalyzersOptions ^ analysisOptions);
public static Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers WithAnalyzers (this Microsoft.CodeAnalysis.Compilation compilation, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer> analyzers, Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzersOptions analysisOptions);
static member WithAnalyzers : Microsoft.CodeAnalysis.Compilation * System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer> * Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzersOptions -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers
<Extension()>
Public Function WithAnalyzers (compilation As Compilation, analyzers As ImmutableArray(Of DiagnosticAnalyzer), analysisOptions As CompilationWithAnalyzersOptions) As CompilationWithAnalyzers

参数

compilation
Compilation

要向其添加分析器的编译。

analyzers
ImmutableArray<DiagnosticAnalyzer>

要包含在将来分析中的分析器集。

analysisOptions
CompilationWithAnalyzersOptions

用于在 中 CompilationWithAnalyzers配置分析器执行的选项。

返回

适用于

WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions, CancellationToken)

Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs
Source:
DiagnosticAnalyzerExtensions.cs

注意

Use WithAnalyzers overload without a cancellation token

返回具有附加诊断分析器的新编译。

public static Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers WithAnalyzers (this Microsoft.CodeAnalysis.Compilation compilation, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer> analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions options = default, System.Threading.CancellationToken cancellationToken = default);
public static Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers WithAnalyzers (this Microsoft.CodeAnalysis.Compilation compilation, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer> analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
[System.Obsolete("Use WithAnalyzers overload without a cancellation token", false)]
public static Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers WithAnalyzers (this Microsoft.CodeAnalysis.Compilation compilation, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer> analyzers, Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions? options, System.Threading.CancellationToken cancellationToken);
static member WithAnalyzers : Microsoft.CodeAnalysis.Compilation * System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer> * Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
[<System.Obsolete("Use WithAnalyzers overload without a cancellation token", false)>]
static member WithAnalyzers : Microsoft.CodeAnalysis.Compilation * System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostics.DiagnosticAnalyzer> * Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.Diagnostics.CompilationWithAnalyzers
<Extension()>
Public Function WithAnalyzers (compilation As Compilation, analyzers As ImmutableArray(Of DiagnosticAnalyzer), Optional options As AnalyzerOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As CompilationWithAnalyzers
<Extension()>
Public Function WithAnalyzers (compilation As Compilation, analyzers As ImmutableArray(Of DiagnosticAnalyzer), options As AnalyzerOptions, cancellationToken As CancellationToken) As CompilationWithAnalyzers

参数

compilation
Compilation

要向其添加分析器的编译。

analyzers
ImmutableArray<DiagnosticAnalyzer>

要包含在将来分析中的分析器集。

options
AnalyzerOptions

传递给分析器的选项。

cancellationToken
CancellationToken

可用于中止分析的取消标记。

返回

属性

适用于