llemaitre19 / jtsx

Extends Emacs JSX/TSX built-in support.
GNU General Public License v3.0
68 stars 2 forks source link

Code folding #6

Closed ramblehead closed 6 months ago

ramblehead commented 6 months ago

Some code folding fixes

see #5 for details

llemaitre19 commented 6 months ago

Thanks, I will review it as soon I have some free time !

Pasting here the description of the PR done in #5.

* The hide-show code is a blend of treesit and regexp approaches. It’s uncertain if this is the best practice. It might need to be refactored to rely solely on treesit queries. * hide-show does not fold js/ts code inside {} fragments in jsx blocks – it only folds the entire {} fragment. * The function jtsx-hs-forward-sexp does not fully support forward-sexp arguments - it always jumps one sexp forward for a positive argument and one sexp backward for a negative argument. * The function jtsx-hs-forward-sexp does not handle js/ts blocks inside jsx blocks. * The function jtsx-backward-up-list does not support backward-up-list arguments - it always jumps up one level.
ramblehead commented 6 months ago

Thank you for merging. Great work! In the upcoming iteration, I plan to delve into ts-fold to explore potential ideas we might integrate or even consider its use as a git submodule. I will also look into strategies to detect JS code nested within JSX, starting with the implementation of your commenting code. If anyone has insights or suggestions on these topics, please feel free to share!

llemaitre19 commented 5 months ago

Glad to hear you are planning some others contributions.

I plan to delve into ts-fold to explore potential ideas we might integrate or even consider its use as a git submodule

I am just remembering that ts-fold did not support build-in tree-sitter 6 months ago, And sadly nothing seems to have changed since then... (issue #48)

If anyone has insights or suggestions on these topics, please feel free to share!

I have activated Discussions tab for that purpose.