ajaxorg/ace — Issue #587: Folding mismatch for CoffeeScript
Author: johnnywengluu
Created: 2011-12-18 19:12:08+00:00
State: open

Here is JS folding for arrays, objects and functions:

alert([
"something"
], "arg2", "arg3");

alert([<->], "arg2", "arg3");

alert({
key: "value"
}, "arg2", "arg3");

alert({<->}, "arg2", "arg3");

alert(function() {
return "something";
}, "arg2", "arg3");

alert(function() {<->}, "arg2", "arg3");

Here is the equivalent CS folding:

alert [
"something"
], "arg2", "arg3"

alert [<->], "arg2", "arg3"

alert {
key: "value"
}, "arg2", "arg3"

alert ->
"something"
, "arg2", "arg3"

alert -><->
, "arg2", "arg3"

So there is 2 issues here:

1. the CS object can't be folded (read this: https://github.com/ajaxorg/ace/issues/581)
2. the arguments for the CS function fold should be after the function like this:

alert -><->, "arg2", "arg3"

to stay consistent with how JS folds.