junyi-hou / tree-sitter-fold

Code-folding using tree-sitter
8 stars 4 forks source link

Added support for Rust #2

Open marcolgl opened 3 years ago

marcolgl commented 3 years ago

Hi, i wrote two functions to support folding in Rust. In particular the following tree-sitter-node-types are folded:

I added two entries in tree-sitter-foldable-node-alist and tree-sitter-fold-range-alist because there are currently (as far as i know) two major mode for rust: rust-mode and rustic-mode . That is redundant but makes folding work in both cases.

I am very new to elisp, so corrections and suggestions are welcome. Thanks for reading and for the work on this package

junyi-hou commented 3 years ago

sorry I was slow to respond, let me check it this week and hopefully merge this. Thanks!

marcolgl commented 3 years ago

No worries, take all the time you need. In the last commit I added two other node-types: