update external tree-sitter config

This commit is contained in:
zedhugh committed 2023-06-10 17:15:48 +08:00
1 parent 8776ef1764
commit 6b7f2d9d0e
1 file changed
+7 -6
+7 -6
View File
@@ -1,11 +1,12 @@
;; -*- coding: utf-8; lexical-binding: t; -*-
(if (bound-and-true-p creature/treesit-available)
(when creature/treesit-available
(let ((ts-enable (treesit-ready-p 'typescript))
(tsx-enable (treesit-ready-p 'tsx)))
(if (and ts-enable tsx-enable)
(progn
(if (treesit-ready-p 'typescript)
(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode)))
(if (treesit-ready-p 'tsx)
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode))))
(add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode))
(add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode)))
(add-subdirs-to-load-path (expand-file-name "optional-pkg" creature/config-dir))
(require 'typescript-mode)
@@ -25,7 +26,7 @@
(with-eval-after-load 'tree-sitter-langs
(tree-sitter-require 'tsx)
(add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))))
(add-to-list 'tree-sitter-major-mode-language-alist '(typescript-tsx-mode . tsx))))))
(defun creature/treesit-convert-to-template ()