]> git.eshelyaron.com Git - emacs.git/commit
Plug tree-sitter-simple-indent into c-offset-alist
authorYuan Fu <casouri@gmail.com>
Thu, 27 Oct 2022 01:31:43 +0000 (18:31 -0700)
committerYuan Fu <casouri@gmail.com>
Thu, 27 Oct 2022 01:41:29 +0000 (18:41 -0700)
commit62c8c8e51a23540cd189d6b2a22dd1a1cdbbf2cb
treed49243cfdf63e9d2e7a1692b43d125f9de45bd22
parent5532ae81cff138a2f6d30c3541210311a4894ac1
Plug tree-sitter-simple-indent into c-offset-alist

Now tree-sitter indentation can produce a cc-engine syntax symbol and
use c-offset-alist to compute the offset.  Catch: line-up functions
don't work with tree-sitter.

* lisp/progmodes/js.el (js--treesit-cc-indent-rules): New variable.
(js-mode): Use cc-indent rules by default.
* lisp/treesit.el (treesit-simple-indent-presets): Consider types as
regexp now.  New matchers: n-p-gp, field-is, top-level, catch-all.
New anchors: nth-sibling, grand-parent, and, or, not, list.
first-sibling now returns the actual first sibling rather than the
first named sibling.
lisp/progmodes/js.el
lisp/treesit.el