FixAllContext Class
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 "Fix all occurrences" code fixes provided by a Microsoft.CodeAnalysis.CodeFixes.FixAllContext.FixAllProvider.
public ref class FixAllContext
public class FixAllContext
type FixAllContext = class
Public Class FixAllContext
- Inheritance
-
FixAllContext
Constructors
FixAllContext(Document, CodeFixProvider, FixAllScope, String, IEnumerable<String>, FixAllContext+DiagnosticProvider, CancellationToken) |
Creates a new FixAllContext. Use this overload when applying fix all to a diagnostic with a source location.
This overload cannot be used with ContainingMember or
ContainingType value for the |
FixAllContext(Document, Nullable<TextSpan>, CodeFixProvider, FixAllScope, String, IEnumerable<String>, FixAllContext+DiagnosticProvider, CancellationToken) |
Creates a new FixAllContext with an associated |
FixAllContext(Project, CodeFixProvider, FixAllScope, String, IEnumerable<String>, FixAllContext+DiagnosticProvider, CancellationToken) |
Creates a new FixAllContext. Use this overload when applying fix all to a diagnostic with no source location, i.e. None. |
Properties
CancellationToken |
CancellationToken for fix all session. |
CodeActionEquivalenceKey |
The EquivalenceKey value expected of a CodeAction participating in this fix all. |
CodeFixProvider |
Underlying CodeFixProvider which triggered this fix all. |
DiagnosticIds |
Diagnostic Ids to fix. Note that GetDocumentDiagnosticsAsync(Document), GetProjectDiagnosticsAsync(Project) and GetAllDiagnosticsAsync(Project) methods return only diagnostics whose IDs are contained in this set of Ids. |
Document |
Document within which fix all occurrences was triggered, null if the FixAllContext is scoped to a project. |
Progress |
Progress sink for reporting the progress of a fix-all operation. |
Project |
Project within which fix all occurrences was triggered. |
Scope |
FixAllScope to fix all occurrences. |
Solution |
Solution to fix all occurrences. |
Methods
GetAllDiagnosticsAsync(Project) |
Gets all the diagnostics in the given project filtered by DiagnosticIds. This includes both document-level diagnostics for all documents in the given project and project-level diagnostics, i.e. diagnostics with no source location, in the given project. |
GetDocumentDiagnosticsAsync(Document) |
Gets all the diagnostics in the given document filtered by DiagnosticIds. |
GetProjectDiagnosticsAsync(Project) |
Gets all the project-level diagnostics, i.e. diagnostics with no source location, in the given project filtered by DiagnosticIds. |
WithCancellationToken(CancellationToken) |
Gets a new FixAllContext with the given cancellationToken. |