CodeFixContext Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CodeFixContext(Document, Diagnostic, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken) |
Creates a code fix context to be passed into RegisterCodeFixesAsync(CodeFixContext) method. |
CodeFixContext(TextDocument, Diagnostic, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken) |
Creates a code fix context to be passed into RegisterCodeFixesAsync(CodeFixContext) method. |
CodeFixContext(Document, TextSpan, ImmutableArray<Diagnostic>, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken) |
Creates a code fix context to be passed into RegisterCodeFixesAsync(CodeFixContext) method. |
CodeFixContext(TextDocument, TextSpan, ImmutableArray<Diagnostic>, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken) |
Creates a code fix context to be passed into RegisterCodeFixesAsync(CodeFixContext) method. |
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
Creates a code fix context to be passed into RegisterCodeFixesAsync(CodeFixContext) method.
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)
Parameters
- document
- Document
Document to fix.
- diagnostic
- Diagnostic
Diagnostic to fix. The Id of this diagnostic must be in the set of the FixableDiagnosticIds of the associated CodeFixProvider.
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
Delegate to register a CodeAction fixing a subset of diagnostics.
- cancellationToken
- CancellationToken
Cancellation token.
- Attributes
Exceptions
Throws this exception if any of the arguments is null.
Applies to
CodeFixContext(TextDocument, Diagnostic, Action<CodeAction,ImmutableArray<Diagnostic>>, CancellationToken)
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
- Source:
- CodeFixContext.cs
Creates a code fix context to be passed into RegisterCodeFixesAsync(CodeFixContext) method.
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)
Parameters
- document
- TextDocument
Text document to fix.
- diagnostic
- Diagnostic
Diagnostic to fix. The Id of this diagnostic must be in the set of the FixableDiagnosticIds of the associated CodeFixProvider.
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
Delegate to register a CodeAction fixing a subset of diagnostics.
- cancellationToken
- CancellationToken
Cancellation token.
Exceptions
Throws this exception if any of the arguments is null.
Applies to
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
Creates a code fix context to be passed into RegisterCodeFixesAsync(CodeFixContext) method.
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)
Parameters
- document
- Document
Document to fix.
- span
- TextSpan
Text span within the document
to fix.
- diagnostics
- ImmutableArray<Diagnostic>
Diagnostics to fix.
All the diagnostics must have the same span
.
Additionally, the Id of each diagnostic must be in the set of the FixableDiagnosticIds of the associated CodeFixProvider.
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
Delegate to register a CodeAction fixing a subset of diagnostics.
- cancellationToken
- CancellationToken
Cancellation token.
- Attributes
Exceptions
Throws this exception if any of the arguments is null.
Throws this exception if the given diagnostics
is empty,
has a null element or has an element whose span is not equal to span
.
Applies to
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
Creates a code fix context to be passed into RegisterCodeFixesAsync(CodeFixContext) method.
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)
Parameters
- document
- TextDocument
Text document to fix.
- span
- TextSpan
Text span within the document
to fix.
- diagnostics
- ImmutableArray<Diagnostic>
Diagnostics to fix.
All the diagnostics must have the same span
.
Additionally, the Id of each diagnostic must be in the set of the FixableDiagnosticIds of the associated CodeFixProvider.
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
Delegate to register a CodeAction fixing a subset of diagnostics.
- cancellationToken
- CancellationToken
Cancellation token.
Exceptions
Throws this exception if any of the arguments is null.
Throws this exception if the given diagnostics
is empty,
has a null element or has an element whose span is not equal to span
.