Skip to content

Commit

Permalink
Use builtin grammar install thingy
Browse files Browse the repository at this point in the history
  • Loading branch information
meain committed Jul 18, 2023
1 parent 9096f3b commit f890429
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions evil-textobj-tree-sitter-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@

(require 'tree-sitter-langs)
(require 'evil-textobj-tree-sitter)
(require 'treesit-auto)
(require 'go-mode)

(setq treesit-auto-install t)
(global-treesit-auto-mode)
;; https://github.com/manateelazycat/lazycat-emacs/blob/b161a3bf36c50291e93f733fc35f937e90ad4afa/site-lisp/config/init-treesit.el#L88
(setq treesit-language-source-alist
'((c . ("https://github.com/tree-sitter/tree-sitter-c"))
(cpp . ("https://github.com/tree-sitter/tree-sitter-cpp"))
(go . ("https://github.com/tree-sitter/tree-sitter-go"))
(gomod . ("https://github.com/camdencheek/tree-sitter-go-mod.git"))))

(treesit-install-language-grammar 'c)
(treesit-install-language-grammar 'cpp)
(treesit-install-language-grammar 'go)
(treesit-install-language-grammar 'gomod)

(defun evil-textobj-tree-sitter--range-test (mode treesit start textobj range content)
"Check ranges of tree-sitter targets.
Expand Down

0 comments on commit f890429

Please sign in to comment.