RefactorAllProvider.Create Method
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
| Name | Description |
|---|---|
| Create(Func<RefactorAllContext,Document,Optional<ImmutableArray<TextSpan>>,Task<Document>>) |
Create a RefactorAllProvider that refactors documents independently. This can be used in the case where refactoring(s) registered by this provider only affect a single Document. |
| Create(Func<RefactorAllContext,Document,Optional<ImmutableArray<TextSpan>>,Task<Document>>, ImmutableArray<RefactorAllScope>) |
Create a RefactorAllProvider that refactors documents independently. This can be used in the case where refactoring(s) registered by this provider only affect a single Document. |
Create(Func<RefactorAllContext,Document,Optional<ImmutableArray<TextSpan>>,Task<Document>>)
- Source:
- RefactorAllProvider.cs
Create a RefactorAllProvider that refactors documents independently. This can be used in the case where refactoring(s) registered by this provider only affect a single Document.
public static Microsoft.CodeAnalysis.CodeRefactorings.RefactorAllProvider Create(Func<Microsoft.CodeAnalysis.CodeRefactorings.RefactorAllContext,Microsoft.CodeAnalysis.Document,Microsoft.CodeAnalysis.Optional<System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Text.TextSpan>>,System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Document?>> refactorAllAsync);
static member Create : Func<Microsoft.CodeAnalysis.CodeRefactorings.RefactorAllContext, Microsoft.CodeAnalysis.Document, Microsoft.CodeAnalysis.Optional<System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Text.TextSpan>>, System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Document>> -> Microsoft.CodeAnalysis.CodeRefactorings.RefactorAllProvider
Public Shared Function Create (refactorAllAsync As Func(Of RefactorAllContext, Document, Optional(Of ImmutableArray(Of TextSpan)), Task(Of Document))) As RefactorAllProvider
Parameters
- refactorAllAsync
- Func<RefactorAllContext,Document,Optional<ImmutableArray<TextSpan>>,Task<Document>>
Callback that will apply the refactorings present in the provided document. The document returned will only be examined for its content (e.g. it's SyntaxTree or SourceText. No other aspects of it (like attributes), or changes to the Project or Solution it points at will be considered.
Returns
Applies to
Create(Func<RefactorAllContext,Document,Optional<ImmutableArray<TextSpan>>,Task<Document>>, ImmutableArray<RefactorAllScope>)
- Source:
- RefactorAllProvider.cs
Create a RefactorAllProvider that refactors documents independently. This can be used in the case where refactoring(s) registered by this provider only affect a single Document.
public static Microsoft.CodeAnalysis.CodeRefactorings.RefactorAllProvider Create(Func<Microsoft.CodeAnalysis.CodeRefactorings.RefactorAllContext,Microsoft.CodeAnalysis.Document,Microsoft.CodeAnalysis.Optional<System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Text.TextSpan>>,System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Document?>> refactorAllAsync, System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.CodeRefactorings.RefactorAllScope> supportedRefactorAllScopes);
static member Create : Func<Microsoft.CodeAnalysis.CodeRefactorings.RefactorAllContext, Microsoft.CodeAnalysis.Document, Microsoft.CodeAnalysis.Optional<System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Text.TextSpan>>, System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Document>> * System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.CodeRefactorings.RefactorAllScope> -> Microsoft.CodeAnalysis.CodeRefactorings.RefactorAllProvider
Public Shared Function Create (refactorAllAsync As Func(Of RefactorAllContext, Document, Optional(Of ImmutableArray(Of TextSpan)), Task(Of Document)), supportedRefactorAllScopes As ImmutableArray(Of RefactorAllScope)) As RefactorAllProvider
Parameters
- refactorAllAsync
- Func<RefactorAllContext,Document,Optional<ImmutableArray<TextSpan>>,Task<Document>>
Callback that will apply the refactorings present in the provided document. The document returned will only be examined for its content (e.g. it's SyntaxTree or SourceText. No other aspects of it (like attributes), or changes to the Project or Solution it points at will be considered.
- supportedRefactorAllScopes
- ImmutableArray<RefactorAllScope>
Supported RefactorAllScopes for the refactor all provider. Note that Custom is not supported by the Microsoft.CodeAnalysis.CodeRefactorings.DocumentBasedRefactorAllProvider and should not be part of the supported scopes.