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

module: add :tools tree-sitter #5401

Merged
merged 80 commits into from
Jun 17, 2022
Merged

Conversation

jeetelongname
Copy link
Member

@jeetelongname jeetelongname commented Aug 20, 2021

This PR adds tree sitter support to doom.
currently it adds:

With plans to add:

  • better code folding using tree sitter (and powered with hideshow!)
  • a better tree visualization mode (similar to the playground on tree sitters website or TSplayground in neovim (package needs to be found or written)
  • functions and query's that leverage tree sitter for statistics and other useful purposes.
  • any other package that is deemed useful!

more information on module development is available on this discourse post
PR's and patches are welcome as well as pointers and suggestions! feel free to ping me on discord if you have any questions.

related issues:

@jeetelongname
Copy link
Member Author

cc: @iyefrat

@ymarco
Copy link
Contributor

ymarco commented Aug 20, 2021

Don't forget to add an entry to modules.org

@iyefrat
Copy link
Member

iyefrat commented Aug 20, 2021

And a doctor.el check for module support

@jeetelongname jeetelongname force-pushed the tree-sitter branch 2 times, most recently from 3b532f2 to 6a0a01c Compare August 20, 2021 13:35
@ymarco
Copy link
Contributor

ymarco commented Aug 20, 2021

Would be nice to list the new textobject keybinds in README.org too

@petr-tik
Copy link
Contributor

a lurker really keen to see this and LSP work together nicely.

Would it make sense to disable lsp semantic highlighting with (setq lsp-semantic-tokens-enable nil) when tree-sitter is enabled ?

@jeetelongname
Copy link
Member Author

jeetelongname commented Aug 21, 2021

a lurker really keen to see this and LSP work together nicely.

Would it make sense to disable lsp semantic highlighting with (setq lsp-semantic-tokens-enable nil) when tree-sitter is enabled ?

Yeah that would make sense. Ill look into it

EDIT: it seems to be disabled by default. Ill see if enabling it causes any problems and add in a check if it does

@meain
Copy link

meain commented Aug 30, 2021

@jeetelongname Just wanted to give you a heads up on the name change of the evil-textobj-treesitter package to evil-textobj-tree-sitter(extra - between tree and sitter). This is done so as to keep it consistent with the other repos (ref). The change will be complete as soon as melpa/melpa#7698 is merged in.

@jeetelongname
Copy link
Member Author

@meain I have been following that and am thankful for the change!

thanks for this!

@jeetelongname jeetelongname force-pushed the tree-sitter branch 3 times, most recently from 6347e98 to 8ce1653 Compare August 31, 2021 00:02
docs/modules.org Outdated Show resolved Hide resolved
@jeetelongname
Copy link
Member Author

jeetelongname commented Sep 1, 2021 via email

@jeetelongname
Copy link
Member Author

jeetelongname commented Sep 1, 2021 via email

@hlissner hlissner added is:feature Adds or requests new features, or extends existing ones re:modules Pertains to adding, removing and management of modules labels Sep 14, 2021
@hlissner hlissner changed the title Adding Treesitter support to doom Add :ui tree-sitter module Sep 14, 2021
@hlissner hlissner changed the title Add :ui tree-sitter module Add :tools tree-sitter module Sep 14, 2021
@jeetelongname
Copy link
Member Author

That should be the final thing, Lets see, I hope to get this merged in the next couple of days / weeks. thanks again to everyone who has helped and commented. Your awesome!

@hlissner hlissner linked an issue May 26, 2022 that may be closed by this pull request
Move the conditional bindings from `i` to `v` this is
to reflect the text object, the thinking being if users have to learn
one anti mnemonic then it should reflect all cases to make it easier to
swallow.
@hlissner hlissner added the module:tools/tree-sitter Pertains to Doom's :tools tree-sitter module label Jun 17, 2022
@hlissner hlissner merged commit 173396a into doomemacs:master Jun 17, 2022
@hlissner
Copy link
Member

And done! Great work @jeetelongname. And thank you to everyone for your help shaping this module with your input and reviews (and putting up with my delays). I'm happy with how it turned out, and look forward to putting it through its paces!

@aisamu
Copy link
Contributor

aisamu commented Jun 17, 2022

Huge thanks to everyone involved!

@mohammedzeglam-pg
Copy link

this module need some improvement with html tree-sitter not working because doom emacs uses web-mode by default to edit html files tree-sitter not enabled until you change to html-mode and i think this well help i was use before doom migrate to tree-sitter
emacs-tree-sitter/tree-sitter-langs#23 (comment)

@jeetelongname
Copy link
Member Author

tsx mode should be supported (and I have not heard any complaints in that regard). The reason I did not enable it for web mode was because while the same method would work, its a worse experience overall imo, both enabling ts in web-mode or defaulting to html-mode that is. It should be trivial to switch over though.

@mohammedzeglam-pg
Copy link

  • playground on tree sitters website

i said i was use this hack and maybe the experience not perfect because tree-sitter not support injection so you do not get highlight for style or script tag but but i love the coloring from tree-sitter and it was the reason number one to use neovim back, but it think about writing new package to support this work

@hlissner hlissner changed the title Add :tools tree-sitter module module: add :tools tree-sitter Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:feature Adds or requests new features, or extends existing ones module:tools/tree-sitter Pertains to Doom's :tools tree-sitter module re:modules Pertains to adding, removing and management of modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tree sitter for syntax highlighting