Skip to content
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

non-ideal split for nested calls, generic types in arg lists #58

Closed
jmesserly opened this issue Dec 4, 2014 · 3 comments
Closed

non-ideal split for nested calls, generic types in arg lists #58

jmesserly opened this issue Dec 4, 2014 · 3 comments
Assignees

Comments

@jmesserly
Copy link

not a big deal, but here's an example where formatting should maybe do something different?

example:

bool doStuff(String firstArgX, {String secondArg, String arg3foo, Map<String,
    String> anotherArg, bool yetAnotherArg: false, bool tooManyArgs: true}) {

I renamed the names from my code, but I think I preserved the length to reproduce :)

ideally it would prefer to split before Map<String, String> instead of splitting the generic type.

@jmesserly
Copy link
Author

the idea would sort of be to respect nesting. Hmmm, maybe this case is similar:

foo(a0, a1, bar(a2_0, a2_1, a2_3), a3, a4, ...)

if possible would be nice if the bar(...) call is kept together. Not sure if it works like that for functions (did not try yet)

@jmesserly
Copy link
Author

Another example was a split here:

/*... code here ...*/ {bool useColors: true, void
    printFn(obj)}

@jmesserly jmesserly changed the title non-ideal split for generic types non-ideal split for nested calls, generic types in arg lists Dec 17, 2014
@jmesserly
Copy link
Author

another comment along the same lines:

When breaking arguments, nested expressions should have a penalty for breaking again. That is:
foo(gee(), bar(x, y)) should not be broken as

foo(gee(), bar(x,
  y))

but rather:

foo(gee(),
       bar(x, y))

Same for longer expressions like x?y:z, or even just o.x.

@munificent munificent self-assigned this Dec 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants