dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.08k stars 4.04k forks source link

Supply formatting options to control location of `:` in multi-line base-lists or constructor initializers #36868

Open CyrusNajmabadi opened 5 years ago

CyrusNajmabadi commented 5 years ago

From https://github.com/dotnet/roslyn/pull/36867

Can you please open an issue for this? I think it would also be nice to have a similar formatting rule for specifying BaseList of a type declaration.

We should have a way to allow users to specify where the : should go if an inheritance list is wrapped or a this()/base() list is wrapped. For example, in Roslyn the vast majority (95%+ of this/base calls include the : with the this/base if this/base is wrapped).

There should be options to help enforce this, which woudl then cause warnings for violations by the formatting anlayzer.

vatsalyaagrawal commented 5 years ago

Design review conclusion: