dotnet / codeformatter

Tool that uses Roslyn to automatically rewrite the source to follow our coding styles
MIT License
1.24k stars 244 forks source link

Add support for C# 7 tuples #258

Closed pgrm closed 6 years ago

pgrm commented 7 years ago

The codeformatter can't deal with the new way of defining tuples in C# 7 (https://docs.microsoft.com/en-us/dotnet/articles/csharp/csharp-7#tuples)

When having the rule active to prefix fields with _ it also prefixes the field names used in the tuple.

javitosanchez commented 7 years ago

Also for expression methods. For example, in this expression: private static (string name, string value) GetData() => ("name", "value"); After applying the tool, I get: private static (private string _name,private string _value) private GetData() => ("name", "value");