CodeRefactoringContext 结构

定义

CodeRefactoringProvider提供的代码重构上下文。

public value class CodeRefactoringContext
public struct CodeRefactoringContext
public readonly struct CodeRefactoringContext
type CodeRefactoringContext = struct
Public Structure CodeRefactoringContext
继承
CodeRefactoringContext

构造函数

CodeRefactoringContext(Document, TextSpan, Action<CodeAction>, CancellationToken)

创建要传递到 ComputeRefactoringsAsync(CodeRefactoringContext) 方法中的代码重构上下文。

CodeRefactoringContext(TextDocument, TextSpan, Action<CodeAction>, CancellationToken)

创建要传递到 ComputeRefactoringsAsync(CodeRefactoringContext) 方法中的代码重构上下文。

属性

CancellationToken

CancellationToken。

Document

对应于 Span 要重构的文档。 对于通过为 提供非默认值 DocumentKinds来支持非源文档的代码重构,此属性将引发 InvalidOperationException。 此类重构应改用 TextDocument 属性。

Span

要重构的 DocumentTextDocument 中的文本范围。

TextDocument

TextDocument 对应于 Span 要重构的 。 应通过为 提供非默认值来支持非源文档的代码重构使用此属性,而不是 Document 属性 DocumentKinds

方法

RegisterRefactoring(CodeAction)

action将 添加到将提供给用户的重构列表。

适用于