diff --git a/configs/init-packages.el b/configs/init-packages.el index a9bcaf4..2c0ab66 100644 --- a/configs/init-packages.el +++ b/configs/init-packages.el @@ -402,6 +402,8 @@ (rust . ("https://github.com/tree-sitter/tree-sitter-rust")) (sql . ("https://github.com/m-novikov/tree-sitter-sql")) (toml . ("https://github.com/tree-sitter/tree-sitter-toml")) + (tsx . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")) + (typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")) (zig . ("https://github.com/GrayJack/tree-sitter-zig")))) (defun nf/treesit-install-all-languages () "Install all languages specified by `treesit-language-source-alist'." diff --git a/configs/lang-js.el b/configs/lang-js.el index 9336a49..6bcd83e 100644 --- a/configs/lang-js.el +++ b/configs/lang-js.el @@ -14,8 +14,13 @@ :ensure nil :mode ("\\.js$" . js-mode) + :init + (add-to-list 'auto-mode-alist '("\\.tsx\\'" . tsx-ts-mode)) + (add-to-list 'auto-mode-alist '("\\.ts\\'" . typescript-ts-mode)) :hook - (js-mode . eglot-ensure) + ((js-mode . eglot-ensure) + (tsx-ts-mode . eglot-ensure) + (typescript-ts-mode . eglot-ensure)) :config (setq js-indent-level 2))