]> git.eshelyaron.com Git - emacs.git/commit
Add tree-sitter functionality to js-mode
authorTheodor Thornhill <theo@thornhill.no>
Sun, 9 Oct 2022 19:22:55 +0000 (21:22 +0200)
committerYuan Fu <casouri@gmail.com>
Mon, 10 Oct 2022 17:25:50 +0000 (10:25 -0700)
commitceb9591e5dcb5264573371a573433fd76320954e
tree3c29b10ba6f57bd7fce01c5b21018782d2f54c83
parent861e1fb595eb1f01ca5c137fb4830695f9c1e7d2
Add tree-sitter functionality to js-mode

The diff for js-mode, js-json-mode, js-jsx-mode are a bit strange, but
all we did is to wrap some the old code in

(if tree-sitter
  (tree-sitter-enable)
 ...some old-code)

...other old-code (that’s tree-sitter-agnostic)

* lisp/progmodes/js.el (treesit): Add tree-sitter dependency
(js-use-treesitter)
(js-json-use-treesitter): New custom options.

(js--treesit-keywords)
(js--treesit-settings)
(js--treesit-indent-rules)
(js--json-treesit-settings)
(js--json-treesit-indent-rules): New variables.

(js--treesit-backward-up-list)
(js-treesit-current-defun)
(js--treesit-move-to-node)
(js--treesit-beginning-of-defun, js--treesit-end-of-defun)
(js--treesit-enable)
(js--json-treesit-enable): New functions.

(js-mode, js-json-mode, js-jsx-mode): Add support for tree-sitter
functionalities.
lisp/progmodes/js.el