@@ -65,7 +65,7 @@ The alist is in form of (major-mode . (foldable-node-type)).")
6565; ; alphabetically sorted
6666(defcustom ts-fold-range-alist
6767 `((agda-mode . ,(ts-fold-parsers-agda))
68- (sh -mode . ,(ts-fold-parsers-bash ))
68+ (elixir -mode . ,(ts-fold-parsers-elixir ))
6969 (c-mode . ,(ts-fold-parsers-c))
7070 (c++-mode . ,(ts-fold-parsers-c++))
7171 (csharp-mode . ,(ts-fold-parsers-csharp))
@@ -87,6 +87,7 @@ The alist is in form of (major-mode . (foldable-node-type)).")
8787 (ruby-mode . ,(ts-fold-parsers-ruby))
8888 (rust-mode . ,(ts-fold-parsers-rust))
8989 (rustic-mode . ,(ts-fold-parsers-rust))
90+ (sh-mode . ,(ts-fold-parsers-bash))
9091 (scala-mode . ,(ts-fold-parsers-scala))
9192 (swift-mode . ,(ts-fold-parsers-swift))
9293 (typescript-mode . ,(ts-fold-parsers-typescript)))
@@ -483,5 +484,16 @@ more information."
483484 (end (1+ (tsc-node-start-position last_bracket))))
484485 (ts-fold--cons-add (cons beg end) offset)))
485486
487+ (defun ts-fold-range-elixir (node offset )
488+ " Return the fold range for `function' `module' NODE in Elixir.
489+
490+ For arguments NODE and OFFSET, see function `ts-fold-range-seq' for
491+ more information."
492+ (when-let* ((children (tsc-count-children node))
493+ (end_child (tsc-get-nth-child node (- children 1 )))
494+ (do_child (tsc-get-nth-child node 1 ))
495+ (beg (tsc-node-start-position do_child))
496+ (end (tsc-node-start-position end_child)))
497+ (ts-fold--cons-add (cons beg end) offset)))
486498(provide 'ts-fold )
487499; ;; ts-fold.el ends here
0 commit comments