From faf976ddabaf0e12db2cfa05724778abc05e2397 Mon Sep 17 00:00:00 2001 From: tslil Date: Tue, 7 Apr 2026 14:05:55 +0100 Subject: [emacs] setup typescript + ts + elgot --- emacs/inits/20-programming.el | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'emacs') diff --git a/emacs/inits/20-programming.el b/emacs/inits/20-programming.el index 21c2f7b..2aa518f 100644 --- a/emacs/inits/20-programming.el +++ b/emacs/inits/20-programming.el @@ -1,4 +1,4 @@ -;; Time-stamp: <2026-04-03 19h58 BST (5733a89e)> +;; Time-stamp: <2026-04-07 14h05 BST (anker)> ;; ----------------------------------------------------------------------------- ;; General setup @@ -26,13 +26,16 @@ (add-to-list 'eglot-server-programs '(bqn-mode . ("bqnlsp"))) (add-to-list 'eglot-server-programs - '(python-ts-mode . ("basedpyright-langserver" "--stdio")))) + '(python-ts-mode . ("basedpyright-langserver" "--stdio"))) + (add-to-list 'eglot-server-programs + '((typescript-ts-mode tsx-ts-mode) . ("typescript-language-server" "--stdio"))) + ) (use-package treesit-auto :custom (treesit-auto-install 'prompt) :config - (setq treesit-auto-langs '(python)) + (setq treesit-auto-langs '(python typescript tsx)) (global-treesit-auto-mode)) (use-package centered-window @@ -281,6 +284,17 @@ :bind (:map json-mode-map ("C-c C-f" . nil))) +(use-package typescript-mode + :ensure + :defer + :hook ((typescript-ts-mode . (lambda () + (eglot-ensure) + (programming-setup))) + (tsx-ts-mode . (lambda () + (eglot-ensure) + (programming-setup)))) + ) + (use-package lua-mode :ensure :defer) -- cgit v1.2.3