-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid formatting when parameters have attributes with many values #1304
Comments
This was done intentially, but changing it is open to debate. If the attributes line up with the parameters it is less clear how many parameters you are dealing with in an example like below. My guess is I ran into some examples from https://github.com/belav/csharpier-repos that I thought looked better with the parameters indented. // lined up attributes and parameters
public void Method(
[Attribute(_________________________longValue, _________________________longValue)]
IReadOnlyList<SomethingObject> somethingObjects,
SomethingObject somethingObject,
SomethingObject somethingObject,
[Attribute(_________________________longValue, _________________________longValue)]
IReadOnlyList<SomethingObject> somethingObjects,
SomethingObject somethingObject
) { }
// indentation of parameters that have a long attribute
public void Method(
[Attribute(_________________________longValue, _________________________longValue)]
IReadOnlyList<SomethingObject> somethingObjects,
SomethingObject somethingObject,
SomethingObject somethingObject,
[Attribute(_________________________longValue, _________________________longValue)]
IReadOnlyList<SomethingObject> somethingObjects,
SomethingObject somethingObject
) { } |
My personal opinion is that indentation doesn't make sense there since it's not a block and there's no nesting of any kind (i.e. the attribute declaration does not "contain" the parameter). I also think it's pretty similar to the following example with properties instead of parameters, which doesn't introduce any indentation on formatting: [Attribute(
Something.Other,
SomethingElse.Other,
Something = Value,
SomeString = "String",
SomeNumber = 1
)]
public object Prop1 { get; }
[Attribute(
Something.Other,
SomethingElse.Other,
Something = Value,
SomeString = "String",
SomeNumber = 1
)]
public object Prop2 { get; } |
Input:
Output:
Expected behavior:
Both parameters, the one with attribute and the one without should have the same indentation
The text was updated successfully, but these errors were encountered: