emacs-tree-sitter / elisp-tree-sitter

Emacs Lisp bindings for tree-sitter
https://emacs-tree-sitter.github.io
MIT License
816 stars 73 forks source link

Add local parser building functionality #220

Open ethan-leba opened 2 years ago

ethan-leba commented 2 years ago

This PR will make it possible for users to build TS grammars locally with no external CLI dependencies, which is a big win for making that an accessible option for users.

A couple points of discussion:

  1. Pulling in tree-sitter-cli brings in a non-trivial amount of unrelated cli-based dependencies in order to use it's tree-sitter generate functionality. Do we think it's worth it?
  2. Building a parser takes about 3s on my machine, more so if we're generating as well. Do we want to consider some sort of asynchronous build option?

I'm open to any and all changes in order to make this PR easier to merge/ fit better with the codebase!

If/when this gets merged, we'd likely also want to rework tree-sitter-langs to use this function.

ethan-leba commented 2 years ago

@ubolonton there appears to be a regression with windows CI unrelated to this PR, tested with an empty commit here: https://github.com/emacs-tree-sitter/elisp-tree-sitter/pull/221

ubolonton commented 2 years ago

Windows CI used to pin Emacs version, but no longer does, after this supposedly temporary change.

This likely means the test hl::face-mapping fails on Emacs 28.