CodeFixContext Constructores
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Sobrecargas
CodeFixContext(Document, Diagnostic, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken) |
Crea un contexto de corrección de código que se pasará al RegisterCodeFixesAsync(CodeFixContext) método . |
CodeFixContext(TextDocument, Diagnostic, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken) |
Crea un contexto de corrección de código que se pasará al RegisterCodeFixesAsync(CodeFixContext) método . |
CodeFixContext(Document, TextSpan, ImmutableArray<Diagnostic>, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken) |
Crea un contexto de corrección de código que se pasará al RegisterCodeFixesAsync(CodeFixContext) método . |
CodeFixContext(TextDocument, TextSpan, ImmutableArray<Diagnostic>, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken) |
Crea un contexto de corrección de código que se pasará al RegisterCodeFixesAsync(CodeFixContext) método . |
CodeFixContext(Document, Diagnostic, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken)
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
Crea un contexto de corrección de código que se pasará al RegisterCodeFixesAsync(CodeFixContext) método .
public:
CodeFixContext(Microsoft::CodeAnalysis::Document ^ document, Microsoft::CodeAnalysis::Diagnostic ^ diagnostic, Action<Microsoft::CodeAnalysis::CodeActions::CodeAction ^, System::Collections::Immutable::ImmutableArray<Microsoft::CodeAnalysis::Diagnostic ^>> ^ registerCodeFix, System::Threading::CancellationToken cancellationToken);
public CodeFixContext (Microsoft.CodeAnalysis.Document document, Microsoft.CodeAnalysis.Diagnostic diagnostic, Action<Microsoft.CodeAnalysis.CodeActions.CodeAction,System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> registerCodeFix, System.Threading.CancellationToken cancellationToken);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public CodeFixContext (Microsoft.CodeAnalysis.Document document, Microsoft.CodeAnalysis.Diagnostic diagnostic, Action<Microsoft.CodeAnalysis.CodeActions.CodeAction,System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> registerCodeFix, System.Threading.CancellationToken cancellationToken);
new Microsoft.CodeAnalysis.CodeFixes.CodeFixContext : Microsoft.CodeAnalysis.Document * Microsoft.CodeAnalysis.Diagnostic * Action<Microsoft.CodeAnalysis.CodeActions.CodeAction, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.CodeFixes.CodeFixContext
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
new Microsoft.CodeAnalysis.CodeFixes.CodeFixContext : Microsoft.CodeAnalysis.Document * Microsoft.CodeAnalysis.Diagnostic * Action<Microsoft.CodeAnalysis.CodeActions.CodeAction, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.CodeFixes.CodeFixContext
Public Sub New (document As Document, diagnostic As Diagnostic, registerCodeFix As Action(Of CodeAction, ImmutableArray(Of Diagnostic)), cancellationToken As CancellationToken)
Parámetros
- document
- Document
Documento que se va a corregir.
- diagnostic
- Diagnostic
Diagnóstico que se va a corregir. El Id objeto de este diagnóstico debe estar en el conjunto de FixableDiagnosticIds de la clase asociada CodeFixProvider.
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
Delegue para registrar una CodeAction corrección de un subconjunto de diagnósticos.
- cancellationToken
- CancellationToken
Token de cancelación.
- Atributos
Excepciones
Produce esta excepción si alguno de los argumentos es NULL.
Se aplica a
CodeFixContext(TextDocument, Diagnostic, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken)
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
Crea un contexto de corrección de código que se pasará al RegisterCodeFixesAsync(CodeFixContext) método .
public CodeFixContext (Microsoft.CodeAnalysis.TextDocument document, Microsoft.CodeAnalysis.Diagnostic diagnostic, Action<Microsoft.CodeAnalysis.CodeActions.CodeAction,System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> registerCodeFix, System.Threading.CancellationToken cancellationToken);
new Microsoft.CodeAnalysis.CodeFixes.CodeFixContext : Microsoft.CodeAnalysis.TextDocument * Microsoft.CodeAnalysis.Diagnostic * Action<Microsoft.CodeAnalysis.CodeActions.CodeAction, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.CodeFixes.CodeFixContext
Public Sub New (document As TextDocument, diagnostic As Diagnostic, registerCodeFix As Action(Of CodeAction, ImmutableArray(Of Diagnostic)), cancellationToken As CancellationToken)
Parámetros
- document
- TextDocument
Documento de texto que se va a corregir.
- diagnostic
- Diagnostic
Diagnóstico que se va a corregir. El Id objeto de este diagnóstico debe estar en el conjunto de FixableDiagnosticIds de la clase asociada CodeFixProvider.
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
Delegue para registrar una CodeAction corrección de un subconjunto de diagnósticos.
- cancellationToken
- CancellationToken
Token de cancelación.
Excepciones
Produce esta excepción si alguno de los argumentos es NULL.
Se aplica a
CodeFixContext(Document, TextSpan, ImmutableArray<Diagnostic>, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken)
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
Crea un contexto de corrección de código que se pasará al RegisterCodeFixesAsync(CodeFixContext) método .
public:
CodeFixContext(Microsoft::CodeAnalysis::Document ^ document, Microsoft::CodeAnalysis::Text::TextSpan span, System::Collections::Immutable::ImmutableArray<Microsoft::CodeAnalysis::Diagnostic ^> diagnostics, Action<Microsoft::CodeAnalysis::CodeActions::CodeAction ^, System::Collections::Immutable::ImmutableArray<Microsoft::CodeAnalysis::Diagnostic ^>> ^ registerCodeFix, System::Threading::CancellationToken cancellationToken);
public CodeFixContext (Microsoft.CodeAnalysis.Document document, Microsoft.CodeAnalysis.Text.TextSpan span, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic> diagnostics, Action<Microsoft.CodeAnalysis.CodeActions.CodeAction,System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> registerCodeFix, System.Threading.CancellationToken cancellationToken);
[System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
public CodeFixContext (Microsoft.CodeAnalysis.Document document, Microsoft.CodeAnalysis.Text.TextSpan span, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic> diagnostics, Action<Microsoft.CodeAnalysis.CodeActions.CodeAction,System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> registerCodeFix, System.Threading.CancellationToken cancellationToken);
new Microsoft.CodeAnalysis.CodeFixes.CodeFixContext : Microsoft.CodeAnalysis.Document * Microsoft.CodeAnalysis.Text.TextSpan * System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic> * Action<Microsoft.CodeAnalysis.CodeActions.CodeAction, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.CodeFixes.CodeFixContext
[<System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)>]
new Microsoft.CodeAnalysis.CodeFixes.CodeFixContext : Microsoft.CodeAnalysis.Document * Microsoft.CodeAnalysis.Text.TextSpan * System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic> * Action<Microsoft.CodeAnalysis.CodeActions.CodeAction, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.CodeFixes.CodeFixContext
Public Sub New (document As Document, span As TextSpan, diagnostics As ImmutableArray(Of Diagnostic), registerCodeFix As Action(Of CodeAction, ImmutableArray(Of Diagnostic)), cancellationToken As CancellationToken)
Parámetros
- document
- Document
Documento que se va a corregir.
- span
- TextSpan
Intervalo de texto dentro de para document
corregir.
- diagnostics
- ImmutableArray<Diagnostic>
Diagnóstico que se va a corregir.
Todos los diagnósticos deben tener el mismo span
.
Además, el Id valor de cada diagnóstico debe estar en el conjunto del objeto del FixableDiagnosticIds asociado CodeFixProvider.
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
Delegue para registrar una CodeAction corrección de un subconjunto de diagnósticos.
- cancellationToken
- CancellationToken
Token de cancelación.
- Atributos
Excepciones
Produce esta excepción si alguno de los argumentos es NULL.
Produce esta excepción si la especificada diagnostics
está vacía, tiene un elemento NULL o tiene un elemento cuyo intervalo no es igual a span
.
Se aplica a
CodeFixContext(TextDocument, TextSpan, ImmutableArray<Diagnostic>, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken)
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
Crea un contexto de corrección de código que se pasará al RegisterCodeFixesAsync(CodeFixContext) método .
public CodeFixContext (Microsoft.CodeAnalysis.TextDocument document, Microsoft.CodeAnalysis.Text.TextSpan span, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic> diagnostics, Action<Microsoft.CodeAnalysis.CodeActions.CodeAction,System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> registerCodeFix, System.Threading.CancellationToken cancellationToken);
new Microsoft.CodeAnalysis.CodeFixes.CodeFixContext : Microsoft.CodeAnalysis.TextDocument * Microsoft.CodeAnalysis.Text.TextSpan * System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic> * Action<Microsoft.CodeAnalysis.CodeActions.CodeAction, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>> * System.Threading.CancellationToken -> Microsoft.CodeAnalysis.CodeFixes.CodeFixContext
Public Sub New (document As TextDocument, span As TextSpan, diagnostics As ImmutableArray(Of Diagnostic), registerCodeFix As Action(Of CodeAction, ImmutableArray(Of Diagnostic)), cancellationToken As CancellationToken)
Parámetros
- document
- TextDocument
Documento de texto que se va a corregir.
- span
- TextSpan
Intervalo de texto dentro de para document
corregir.
- diagnostics
- ImmutableArray<Diagnostic>
Diagnóstico que se va a corregir.
Todos los diagnósticos deben tener el mismo span
.
Además, el Id valor de cada diagnóstico debe estar en el conjunto del objeto del FixableDiagnosticIds asociado CodeFixProvider.
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
Delegue para registrar una CodeAction corrección de un subconjunto de diagnósticos.
- cancellationToken
- CancellationToken
Token de cancelación.
Excepciones
Produce esta excepción si alguno de los argumentos es NULL.
Produce esta excepción si la especificada diagnostics
está vacía, tiene un elemento NULL o tiene un elemento cuyo intervalo no es igual a span
.