Renamer.RenameDocumentAsync 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 |
|---|---|
| RenameDocumentAsync(Document, DocumentRenameOptions, String, IReadOnlyList<String>, CancellationToken) |
Call to perform a rename of document or change in document folders. Returns additional code changes related to the document being modified, such as renaming symbols in the file. Each change is added as a Renamer.RenameDocumentAction in the returned ApplicableActions. Each action may individually encounter errors that prevent it from behaving correctly. Those are reported in GetErrors(CultureInfo). Current supported actions that may be returned: |
| RenameDocumentAsync(Document, String, IReadOnlyList<String>, OptionSet, CancellationToken) |
Obsolete.
Call to perform a rename of document or change in document folders. Returns additional code changes related to the document being modified, such as renaming symbols in the file. Each change is added as a Renamer.RenameDocumentAction in the returned ApplicableActions. Each action may individually encounter errors that prevent it from behaving correctly. Those are reported in GetErrors(CultureInfo). Current supported actions that may be returned: |
RenameDocumentAsync(Document, DocumentRenameOptions, String, IReadOnlyList<String>, CancellationToken)
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
Call to perform a rename of document or change in document folders. Returns additional code changes related to the document being modified, such as renaming symbols in the file.
Each change is added as a Renamer.RenameDocumentAction in the returned ApplicableActions.
Each action may individually encounter errors that prevent it from behaving correctly. Those are reported in GetErrors(CultureInfo).
Current supported actions that may be returned:
public static System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Rename.Renamer.RenameDocumentActionSet> RenameDocumentAsync(Microsoft.CodeAnalysis.Document document, Microsoft.CodeAnalysis.Rename.DocumentRenameOptions options, string? newDocumentName, System.Collections.Generic.IReadOnlyList<string>? newDocumentFolders = default, System.Threading.CancellationToken cancellationToken = default);
static member RenameDocumentAsync : Microsoft.CodeAnalysis.Document * Microsoft.CodeAnalysis.Rename.DocumentRenameOptions * string * System.Collections.Generic.IReadOnlyList<string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Rename.Renamer.RenameDocumentActionSet>
Public Shared Function RenameDocumentAsync (document As Document, options As DocumentRenameOptions, newDocumentName As String, Optional newDocumentFolders As IReadOnlyList(Of String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Renamer.RenameDocumentActionSet)
Parameters
- document
- Document
The document to be modified
- options
- DocumentRenameOptions
Options used to configure rename of a type contained in the document that matches the document's name.
- newDocumentName
- String
The new name for the document. Pass null or the same name to keep unchanged.
- newDocumentFolders
- IReadOnlyList<String>
The new set of folders for the Folders property
- cancellationToken
- CancellationToken
Returns
Applies to
RenameDocumentAsync(Document, String, IReadOnlyList<String>, OptionSet, CancellationToken)
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
- Source:
- Renamer.cs
Caution
Use overload taking RenameOptions
Call to perform a rename of document or change in document folders. Returns additional code changes related to the document being modified, such as renaming symbols in the file.
Each change is added as a Renamer.RenameDocumentAction in the returned ApplicableActions.
Each action may individually encounter errors that prevent it from behaving correctly. Those are reported in GetErrors(CultureInfo).
Current supported actions that may be returned:
public static System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Rename.Renamer.RenameDocumentActionSet> RenameDocumentAsync(Microsoft.CodeAnalysis.Document document, string newDocumentName, System.Collections.Generic.IReadOnlyList<string>? newDocumentFolders = default, Microsoft.CodeAnalysis.Options.OptionSet? optionSet = default, System.Threading.CancellationToken cancellationToken = default);
[System.Obsolete("Use overload taking RenameOptions")]
public static System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Rename.Renamer.RenameDocumentActionSet> RenameDocumentAsync(Microsoft.CodeAnalysis.Document document, string? newDocumentName, System.Collections.Generic.IReadOnlyList<string>? newDocumentFolders = default, Microsoft.CodeAnalysis.Options.OptionSet? optionSet = default, System.Threading.CancellationToken cancellationToken = default);
static member RenameDocumentAsync : Microsoft.CodeAnalysis.Document * string * System.Collections.Generic.IReadOnlyList<string> * Microsoft.CodeAnalysis.Options.OptionSet * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Rename.Renamer.RenameDocumentActionSet>
[<System.Obsolete("Use overload taking RenameOptions")>]
static member RenameDocumentAsync : Microsoft.CodeAnalysis.Document * string * System.Collections.Generic.IReadOnlyList<string> * Microsoft.CodeAnalysis.Options.OptionSet * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.CodeAnalysis.Rename.Renamer.RenameDocumentActionSet>
Public Shared Function RenameDocumentAsync (document As Document, newDocumentName As String, Optional newDocumentFolders As IReadOnlyList(Of String) = Nothing, Optional optionSet As OptionSet = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Renamer.RenameDocumentActionSet)
Parameters
- document
- Document
The document to be modified
- newDocumentName
- String
The new name for the document. Pass null or the same name to keep unchanged.
- newDocumentFolders
- IReadOnlyList<String>
The new set of folders for the Folders property
- optionSet
- OptionSet
- cancellationToken
- CancellationToken
Returns
- Attributes