-
-
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
Improve formatting of Field with Array Initializer #290
Comments
The code in RightHandSide is probably what needs to change, but there are a ton of edge cases that get ruined every time I attemp to figure out how to get this working. |
There is also the question of if this should break, because it has multiple items
private string[] SomeArray = new[]
{
"SomeValue_____________________",
"SomeValue_____________________",
};
// or if it should stick to one line, because it is short enough
private string[] SomeArray =
new[] { "SomeValue_____________________", "SomeValue_____________________", }; |
Also note that prettier doesn't do this for objects or arrays var someSemiLongName_____________ = {
one: "one_____________________________________",
};
var someSemiLongName_____________ = [
"one_____________________________________",
]; |
As of 8/7 with the changes for #345, this can be done by printing But that means we get this, which we don't want int[] array =
new int[]
{
"someLongValue_____________________________________",
"someLongValue_____________________________________"
}; We could possibly try to determine the length of the right side and decide that way. Prettier does something like that in assignment.js. |
#269 is also related to this |
The text was updated successfully, but these errors were encountered: