Prettier pretty printing#78
Conversation
* This improves the pretty printing of deeply nested if/else if chains
|
Hi. Thanks a lot. The examples look good. Haven't had a chance to have a look at the changes, nor Travis complaints. The following is only loosely related to this PR. I'd appreciate if you could pitch in some insight on it while I'm looking at the diffs. One thing I would probably want to do in the near future is port those changes to the 'es5' branch (https://github.com/jswebtools/language-ecmascript/blob/es5/src/Language/ECMAScript5/PrettyPrint.hs) which would eventually become the next iteration of this package. In that regard, I have two questions:
|
|
Oh, didn't know about that branch... I could port it in the following days, probably. I am not sure about the I willl need to do some research to understand whether the equivalent behavior is possible. |
the next line to be aligned in right of equals sign
|
https://github.com/Peaker/language-ecmascript/commits/prettier_es5 This one is ported on top of the es5 branch. |
|
Very pretty. Thank you! I've merged the changes against 'es5' as well. Don't worry about porting to |
|
@Peaker, one more thing, how should I include your copyright in the license and package meta-data? Is "(c) 2016 Eyal Lotem" good? Once you confirm, I'll roll out the update as 0.17.1.0 on Hackage. |
|
That's great thanks :) On Sun, Feb 28, 2016, 17:56 Andrey Chudnov notifications@github.com wrote:
|
Improve the Javascript output to look a lot more like a human wrote it.
Original: https://gist.github.com/Peaker/550f0c0259d87caf6546
Improved: https://gist.github.com/Peaker/13a1e6c6fc216ad61f54
Indent/nest things better.
Allow if/else-if chains to avoid lots of nesting.
If you dislike some of these formatting changes, you could drop specific commits, as you can see they are quite fine-grained :)