From 3f1c45ac0af803a0e5e2966a49a7021828115bfd Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 27 May 2023 17:32:45 -0400 Subject: [PATCH] Update js and css for emacs29. --- ansible/roles/emacs/files/lang-javascript.el | 57 ++++++++------------ 1 file changed, 23 insertions(+), 34 deletions(-) diff --git a/ansible/roles/emacs/files/lang-javascript.el b/ansible/roles/emacs/files/lang-javascript.el index 9e3575e..1cfceba 100644 --- a/ansible/roles/emacs/files/lang-javascript.el +++ b/ansible/roles/emacs/files/lang-javascript.el @@ -48,42 +48,31 @@ (unless (treesit-ready-p 'typescript) (treesit-install-language-grammar 'typescript)) ) +(use-package js-ts-mode + :ensure nil + :pin manual + :mode ( + ("\\.js\\'" . js-ts-mode) + ) + :commands (js-ts-mode) + :init + (add-to-list 'treesit-language-source-alist '(javascript . ("https://github.com/tree-sitter/tree-sitter-javascript" "master" "src"))) + (unless (treesit-ready-p 'javascript) (treesit-install-language-grammar 'javascript)) + ) + +(use-package css-ts-mode + :ensure nil + :pin manual + :mode ( + ("\\.css\\'" . css-ts-mode) + ) + :commands (css-ts-mode) + :init + (add-to-list 'treesit-language-source-alist '(css "https://github.com/tree-sitter/tree-sitter-css")) + (unless (treesit-ready-p 'css) (treesit-install-language-grammar 'css)) + ) -;; (use-package js -;; :mode ( -;; ("\\.js\\'" . js-mode) -;; ("\\.json\\'" . js-mode) -;; ) -;; :commands js-mode -;; :pin manual -;; :hook ( -;; (find-file . (lambda () (when (string= (file-name-extension buffer-file-name) "json") (add-hook 'before-save-hook 'json-fmt-jq nil 'local)))) -;; (js-mode . (lambda () -;; (tree-sitter-hl-mode +1) -;; ) -;; ) -;; ) -;; :config -;; (setq js-indent-level 2) -;; ) -;; (use-package typescript-mode -;; :mode ( -;; ("\\.ts\\'" . typescript-mode) -;; ("\\.tsx\\'" . typescript-mode) -;; ) -;; :hook ( -;; (typescript-mode . (lambda () -;; ;; (lsp-register-client -;; ;; (make-lsp-client :new-connection (lsp-stdio-connection '("deno" "lsp" --compat --unstable --allow-read)) -;; ;; :major-modes '(typescript-mode) -;; ;; :server-id 'typescript-ls)) -;; (eglot-ensure) -;; (tree-sitter-hl-mode +1) -;; )) -;; ;; (before-save . lsp-format-buffer) -;; ) -;; ) ;; (use-package web-mode ;; :mode (("\\.dust\\'" . web-mode) ;; )