Treesitter module developement

This file contains links and information pertinent to the tree sitter module.

design decisions

  • should tree sitter support for languages be opt in? (like lsp) This would make sense as tree sitter support is spotty at best and people can opt in with a +treesitter flag

languages

Hacks in testing

  • scss currently this snippet adds scss “support”. it mostly works but the tree errors on most scss specific syntax. I have not gone very deep but it does work for basics examples
        (after! tree-sitter
          (pushnew! tree-sitter-major-mode-language-alist
                    '(scss-mode . css)))
    

text objects

  • bind keys to tree sitter text objects

  • only rebind to tree sitter text-objs if the language supports tree sitter

    • This can be achieved by either making a variable of major modes that have tree

    sitter support (which requires a little bit of fore thought)

    • or rebind keys if a tree-sitter error is raised (which is slower but easier to maintain:tm:)
  • Handle bad bounding 0 1 error to emmit a more useful message

Current bugs

  • text objects can’t seem to be rebound? currently i can’t rebind text objects using the conventional methods

  • in some conditions a Bad bounding indices: 0, 1 error is raised. This is due to the query needed not existing. The easiest fix would be to add these querys but this is easier said than done

  • Tree sitter somehow is being eager loaded

plugins

To look for / write

To consider adding

misc

Witticism

  • current candidate:
    • the :emacs vc module stole our tree joke
3 Likes

Hi @jeetelongname, did not know where else to ask this, so putting here.

I see Elixir module does not have tree-sitter flag, but there is grammar for it already present. Any chance to get it enabled? Otherwise, how much added complexity would it be to add it? Asking because my elisp-fu is barely novice level, but might even give it a shot.

Hi,

It should do. I have it added to my init.el and its documented in the elixir readme [1]. It does not have a highlights file (though one is in the works afik). though. everything else should work :tm:

Footnotes ─────────

[1] https://github.com/doomemacs/doomemacs/blob/c44bc81a05f3758ceaa28921dd9c830b9c571e61/modules/lang/elixir/README.org#module-flags Regards, – Jeetaditya Chatterjee /Sent using my text editor/

Ah indeed it does. My bookmark to modules.org was for develop branch and turns out it was never updated after switch to master.

Thank you for confirming and working on it!

1 Like