CodeRefactoringContext Struct
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.
Context for code refactorings provided by a CodeRefactoringProvider.
public value class CodeRefactoringContext
public struct CodeRefactoringContext
public readonly struct CodeRefactoringContext
type CodeRefactoringContext = struct
Public Structure CodeRefactoringContext
- Inheritance
-
CodeRefactoringContext
Constructors
CodeRefactoringContext(Document, TextSpan, Action<CodeAction>, CancellationToken) |
Creates a code refactoring context to be passed into ComputeRefactoringsAsync(CodeRefactoringContext) method. |
CodeRefactoringContext(TextDocument, TextSpan, Action<CodeAction>, CancellationToken) |
Creates a code refactoring context to be passed into ComputeRefactoringsAsync(CodeRefactoringContext) method. |
Properties
CancellationToken |
CancellationToken. |
Document |
Document corresponding to the Span to refactor. For code refactorings that support non-source documents by providing a non-default value for DocumentKinds, this property will throw an InvalidOperationException. Such refactorings should use the TextDocument property instead. |
Span |
Text span within the Document or TextDocument to refactor. |
TextDocument |
TextDocument corresponding to the Span to refactor. This property should be used instead of Document property by code refactorings that support non-source documents by providing a non-default value for DocumentKinds |
Methods
RegisterRefactoring(CodeAction) |
Add supplied |