Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more nodes to elisp parser, remove s dependency, add vimscript #6

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

DevelopmentCool2449
Copy link
Contributor

@DevelopmentCool2449 DevelopmentCool2449 commented Jun 19, 2024

This commit includes some new features and changes:

  • Add more nodes/rule set to elisp parser. This add support for folding lists and special forms such as if, defvar and etc.
  • Remove dependency in s.el library. There was only 1 function from s.el in use, i replaced it by its built-in alternative.
  • Add vimscript support through vimscript-ts-mode. It only add folding for functions and if conditionals.
  • Add more missing *-ts-modes to treesit-fold-range-alist list. This also remove some modes that doesn't exists or unlikely to exist.

@DevelopmentCool2449 DevelopmentCool2449 force-pushed the master branch 4 times, most recently from 946be82 to 6774734 Compare June 19, 2024 21:01
treesit-fold-parsers.el Outdated Show resolved Hide resolved
treesit-fold.el Outdated Show resolved Hide resolved
This commit includes some new features and changes:
* Add more nodes/rule set to elisp parser.
  This add support for folding lists and special forms such as `if`,
  `defvar` and etc.
* Remove dependency in `s.el` library.
  There was only 1 function from s.el in use, it was replaced by
  its built-in alternative.
* Add vimscript support through vimscript-ts-mode.
  It only add folding for `functions` and `if` conditionals.
* Add more missing `*-ts-modes` to `treesit-fold-range-alist` list.
  This also rmeove some modes that doesn't exists or unlikely to
  exist.
treesit-fold.el Outdated
@@ -63,6 +62,7 @@
(agda-mode . ,(treesit-fold-parsers-agda))
(arduino-mode . ,(treesit-fold-parsers-arduino))
(asm-mode . ,(treesit-fold-parsers-asm))
(awk-mode . ,(treesit-fold-parsers-c))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create a specific parser function for Awk? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as far as i know awk uses some of c syntax, such as if, switch, for and while.
so i don't think it should be necessary (for now)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to wrap it like this: 🤔

(defun treesit-fold-parsers-awk ()
  "Rule set for Awk."
  (append (treesit-fold-parsers-c)))

And tree-sitter-awk doesn't seem to build on top of the tree-sitter-c. Maybe add a comment ;; TODO:besides it. 🤔

Copy link
Contributor Author

@DevelopmentCool2449 DevelopmentCool2449 Jun 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to wrap it like this: 🤔

(defun treesit-fold-parsers-awk ()
  "Rule set for Awk."
  (append (treesit-fold-parsers-c)))

And tree-sitter-awk doesn't seem to build on top of the tree-sitter-c. Maybe add a comment ;; TODO:besides it. 🤔

Done.

@jcs090218
Copy link
Member

LGTM! I appreciate your cooperation!

@jcs090218 jcs090218 merged commit 4d8e9ce into emacs-tree-sitter:master Jun 20, 2024
5 of 6 checks passed
@DevelopmentCool2449
Copy link
Contributor Author

LGTM! I appreciate your cooperation!

Thank you, also i would like to know if there are plans for submit this package to nonGNU ELPA.
I have already some changes for allow the submition.

@jcs090218
Copy link
Member

I never submitted a package to nonGNU ELPA since I already have my own ELPA, JCS-ELPA. Anyone can submit this package to non-GNU ELPA if they want to. :)

@DevelopmentCool2449
Copy link
Contributor Author

I never submitted a package to nonGNU ELPA since I already have my own ELPA, JCS-ELPA. Anyone can submit this package to non-GNU ELPA if they want to. :)

Glad to know, i've open a PR that is the last step to allow submiting it to NonGNU.
If there is no any problem also i would like to be the person to send a request for NonGNU submition.

@jcs090218
Copy link
Member

If there is no any problem also i would like to be the person to send a request for NonGNU submition.

Feel free to do so!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants