satyr/coco — Issue #115: Retain do-block and chained .method newlines in compiled javascript
Author: blendmaster
Created: 2012-03-07 05:16:54+00:00
State: open

The do block and spaced dot attribute syntax make for really nice looking coco, but the compiled javascript collapses all the newlines inside a do-block or the usual jQuery chaining style method calls:

```coffeescript
method do
firstArgument
secondArgument
thirdArgument

object
.chain stuff, ->
method
.chain more_stuff, with_multiple_args
.chain even_more_stuff
```

currently compiles to

```javascript
method(firstArgument, secondArgument, thirdArgument);
object.chain(stuff, function(){
return method;
}).chain(more_stuff, with_multiple_args).chain(even_more_stuff);
```

I'd like it to compile to:

```javascript
method(
firstArgument,
secondArgument,
thirdArgument);

object
.chain(stuff, function(){
return method;
})
.chain(more_stuff, with_multiple_args)
.chain(even_more_stuff);
```

which would make reading and debugging the resulting javascript easier, especially for methods with lots of arguments or complicated expressions as arguments.