-
Notifications
You must be signed in to change notification settings - Fork 14
Code Folding
CodeMirror-XQuery provides the addon/fold/autofolding.js which folds the code according a configuration (which depends of the mode (xquery, javascript, etc...) and fold type (comments, brace, xml tags, indent, etc).
You can play with XQuery folding with the online demo.
The addon/fold/auofolding-xquery.js configure the folding like this:
- comments (starts with '(:' and ends with) are folded. On the xquery code loading, comments folding are collapsed.
- brace ('{' and '}') are folded. On the xquery code loading, brace folding are elapsed.
- xml tags are folded. On the xquery code loading, xml tags folding are elapsed.
So, it's very easy to create your own configuration to manage other mode (javascript, xml, etc).
On the xquery code loading:
- comments folding are collapsed:

- brace ('{' and '}') folding are elapsed:

- xml tags folding are elapsed:

When code folding is collapsed, you can elapse it with the left pulse gutter or right widget :

Once the code folding is elapsed, the pulse changes and you can re-collapse it :

Code Folding works too when code editor changes. If you starts writing comments (with '(:'), the left pulse gutter appears :

If you remove starts of comments, the pulse disappears :
