CodeFixContext 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
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
创建要传递到 RegisterCodeFixesAsync(CodeFixContext) 方法中的代码修复上下文。
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)
参数
- document
- Document
要修复的文档。
- diagnostic
- Diagnostic
要修复的诊断。 Id此诊断的 必须位于关联 CodeFixProvider的 的 集中FixableDiagnosticIds。
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
委托注册CodeAction修复诊断子集。
- cancellationToken
- CancellationToken
取消标记。
- 属性
例外
如果任何参数为 null,则引发此异常。
适用于
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
创建要传递到 RegisterCodeFixesAsync(CodeFixContext) 方法中的代码修复上下文。
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)
参数
- document
- TextDocument
要修复的文本文档。
- diagnostic
- Diagnostic
要修复的诊断。 Id此诊断的 必须位于关联 CodeFixProvider的 的 集中FixableDiagnosticIds。
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
委托注册CodeAction修复诊断子集。
- cancellationToken
- CancellationToken
取消标记。
例外
如果任何参数为 null,则引发此异常。
适用于
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
创建要传递到 RegisterCodeFixesAsync(CodeFixContext) 方法中的代码修复上下文。
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)
参数
- document
- Document
要修复的文档。
- span
- TextSpan
要修复的 内 document
的文本范围。
- diagnostics
- ImmutableArray<Diagnostic>
要修复的诊断。
所有诊断必须具有相同span
的 。
此外,Id每个诊断的 必须位于关联 CodeFixProvider的 的集中FixableDiagnosticIds。
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
委托注册CodeAction修复诊断子集。
- cancellationToken
- CancellationToken
取消标记。
- 属性
例外
如果任何参数为 null,则引发此异常。
如果给定 diagnostics
的 为空、具有 null 元素或具有范围不等于 span
的元素,则引发此异常。
适用于
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
创建要传递到 RegisterCodeFixesAsync(CodeFixContext) 方法中的代码修复上下文。
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)
参数
- document
- TextDocument
要修复的文本文档。
- span
- TextSpan
要修复的 内 document
的文本范围。
- diagnostics
- ImmutableArray<Diagnostic>
要修复的诊断。
所有诊断必须具有相同span
的 。
此外,Id每个诊断的 必须位于关联 CodeFixProvider的 的集中FixableDiagnosticIds。
- registerCodeFix
- Action<CodeAction,ImmutableArray<Diagnostic>>
委托注册CodeAction修复诊断子集。
- cancellationToken
- CancellationToken
取消标记。
例外
如果任何参数为 null,则引发此异常。
如果给定 diagnostics
的 为空、具有 null 元素或具有范围不等于 span
的元素,则引发此异常。