| 1 | ; Fold ranges for Nix. |
| 2 | ; |
| 3 | ; Nix has no syntactic block construct (no `{ ... }` statement blocks) |
| 4 | ; - every region is an expression. The folds below cover the |
| 5 | ; expression forms that are commonly multi-line in real Nix code. |
| 6 | ; |
| 7 | ; Capture set matches nvim-treesitter's vendored `runtime/queries/nix/ |
| 8 | ; folds.scm`, plus the additions noted at the bottom. |
| 9 | ; |
| 10 | ; Editors compute fold regions from each captured node's range. |
| 11 | ; Single-line captures are harmless. |
| 12 | [ |
| 13 | (if_expression) |
| 14 | (with_expression) |
| 15 | (let_expression) |
| 16 | (function_expression) |
| 17 | (attrset_expression) |
| 18 | (rec_attrset_expression) |
| 19 | (list_expression) |
| 20 | (indented_string_expression) |
| 21 | (let_attrset_expression) |
| 22 | ] @fold |
| 23 | |
| 24 | ; Additions over the nvim-treesitter reference set --------------------- |
| 25 | |
| 26 | ; Multi-line block / doc comments. |
| 27 | [ |
| 28 | (block_comment) |
| 29 | (doc_comment) |
| 30 | ] @fold |