DiagnosticAnalyzerExtensions.WithAnalyzers Método
Definição
Importante
Algumas informações se referem a produtos de pré-lançamento que podem ser substancialmente modificados antes do lançamento. A Microsoft não oferece garantias, expressas ou implícitas, das informações aqui fornecidas.
Sobrecargas
WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions) |
Retorna uma nova compilação com analisadores de diagnóstico anexados. |
WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, CompilationWithAnalyzersOptions) |
Retorna uma nova compilação com analisadores de diagnóstico anexados. |
WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions, CancellationToken) |
Obsoleto.
Retorna uma nova compilação com analisadores de diagnóstico anexados. |
WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions)
Retorna uma nova compilação com analisadores de diagnóstico anexados.
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
Parâmetros
- compilation
- Compilation
Compilação à qual os analisadores devem ser adicionados.
- analyzers
- ImmutableArray<DiagnosticAnalyzer>
O conjunto de analisadores a serem incluídos em análises futuras.
- options
- AnalyzerOptions
Opções que são passadas para analisadores.
Retornos
Aplica-se a
WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, CompilationWithAnalyzersOptions)
Retorna uma nova compilação com analisadores de diagnóstico anexados.
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
Parâmetros
- compilation
- Compilation
Compilação à qual os analisadores devem ser adicionados.
- analyzers
- ImmutableArray<DiagnosticAnalyzer>
O conjunto de analisadores a serem incluídos em análises futuras.
- analysisOptions
- CompilationWithAnalyzersOptions
Opções para configurar a execução do analisador em CompilationWithAnalyzers.
Retornos
Aplica-se a
WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions, CancellationToken)
Cuidado
Use WithAnalyzers overload without a cancellation token
Retorna uma nova compilação com analisadores de diagnóstico anexados.
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
Parâmetros
- compilation
- Compilation
Compilação à qual os analisadores devem ser adicionados.
- analyzers
- ImmutableArray<DiagnosticAnalyzer>
O conjunto de analisadores a serem incluídos em análises futuras.
- options
- AnalyzerOptions
Opções que são passadas para analisadores.
- cancellationToken
- CancellationToken
Um token de cancelamento que pode ser usado para anular a análise.
Retornos
- Atributos