diff --git a/ansible/roles/emacs/files/lang-javascript.el b/ansible/roles/emacs/files/lang-javascript.el index 1cfceba..7bd847e 100644 --- a/ansible/roles/emacs/files/lang-javascript.el +++ b/ansible/roles/emacs/files/lang-javascript.el @@ -30,6 +30,13 @@ ("\\.tsx\\'" . tsx-ts-mode) ) :commands (tsx-ts-mode) + :hook ( + (tsx-ts-mode . (lambda () + (when-linux + (eglot-ensure) + ) + )) + ) :init (add-to-list 'treesit-language-source-alist '(tsx . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src"))) (unless (treesit-ready-p 'tsx) (treesit-install-language-grammar 'tsx)) @@ -43,6 +50,13 @@ ("\\.ts\\'" . typescript-ts-mode) ) :commands (typescript-ts-mode) + :hook ( + (typescript-ts-mode . (lambda () + (when-linux + (eglot-ensure) + ) + )) + ) :init (add-to-list 'treesit-language-source-alist '(typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src"))) (unless (treesit-ready-p 'typescript) (treesit-install-language-grammar 'typescript)) diff --git a/ansible/roles/emacs/tasks/linux.yaml b/ansible/roles/emacs/tasks/linux.yaml index b5e48cf..68687dd 100644 --- a/ansible/roles/emacs/tasks/linux.yaml +++ b/ansible/roles/emacs/tasks/linux.yaml @@ -5,4 +5,5 @@ - prettier # typescript+yaml formatting - pyright - gopls + - typescript-language-server state: present