You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Obsolete("Will be removed in a future version. Please replace any use of this class with some other class.")]
Output:
[Obsolete("Will be removed in a future version. Please replace any use of this class with some other class.")]
Expected behavior:
[Obsolete("Will be removed in a future version. Please replace any use of this class with some other class.")]
For cases like this breaking the statement up into multiple lines is not really helpful even if it surpasses the maximum line length. It's not possible to break up the string expression so you only end up indenting it slightly less and using three lines instead of one without really reducing the length of the line.
Could there maybe be an exception for attributes or methods with a single argument where the argument itself surpasses the line length? It could be limited to attributes but I've also seen method calls like this where it might make more sense to keep everything on one line:
Debug.Log("A veeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeery long string");
Thanks for the great work on CSharpier! :)
The text was updated successfully, but these errors were encountered:
Great suggestion, I've gotten a bit annoyed with attributes breaking this way.
Treating method calls the same way seems reasonable. I feel like I may have implemented a similar rule for an if condition when it only contains a single operator.
The csproj/xml formatting I have in progress has similar rules about not breaking an empty element with a single attribute, and an element with no attributes and just a single line of text within it.
I would agree that multiline attributes is kinda annoying.
My personal opinion is usually keep them one line.
However, for csharpier, would the rule be that IF the attribute line is longer than max length AND after breaking onto multiple lines there is an overflowing line (e.g. the string), then just keep it all on one line?
Input:
Output:
Expected behavior:
For cases like this breaking the statement up into multiple lines is not really helpful even if it surpasses the maximum line length. It's not possible to break up the string expression so you only end up indenting it slightly less and using three lines instead of one without really reducing the length of the line.
Could there maybe be an exception for attributes or methods with a single argument where the argument itself surpasses the line length? It could be limited to attributes but I've also seen method calls like this where it might make more sense to keep everything on one line:
Thanks for the great work on CSharpier! :)
The text was updated successfully, but these errors were encountered: