dotnet/roslyn
Vedi su GitHubMove static members has incorrect formatting after moving to nested type
Open
#74.054 aperta il 18 giu 2024
Area-IDEhelp wanted
Metriche repository
- Star
- (20.414 star)
- Metriche merge PR
- (Merge medio 6g 17h) (256 PR mergiate in 30 g)
Descrizione
(found in https://github.com/dotnet/roslyn/pull/74037)
Before:
namespace ConsoleApp3;
public static class WorkflowValidations
{
public static class WorkflowTypes
{
public const string FirstType = "firstType";
}
private static readonly System.Collections.Generic.List<string> validWorkflowTypes = new System.Collections.Generic.List<string>()
{
"firstType"
};
// Moving this method and above dependency into WorkflowTypes static class
public static bool IsValidWorkflowType(this string workflowType) => validWorkflowTypes.Contains(workflowType);
}
Trigger move static members, select both members and move to WorkflowTypes, results in correct code, but incorrect formatting
namespace ConsoleApp3;
public static class WorkflowValidations
{
public static class WorkflowTypes
{
public const string FirstType = "firstType";
private static readonly System.Collections.Generic.List<string> validWorkflowTypes = new System.Collections.Generic.List<string>()
{
"firstType"
};
// Moving this method and above dependency into WorkflowTypes static class
public static bool IsValidWorkflowType(this string workflowType) => validWorkflowTypes.Contains(workflowType);
}
}