From 6352fbb6979c4b68b410a3a0f98cd415f429d978 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 19 Sep 2024 10:39:40 -0400 Subject: [PATCH] Use web-mode for astro --- emacs/.emacs.d/config/init-astro.el | 12 ++---------- emacs/.emacs.d/config/init-ide.el | 8 ++++---- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/emacs/.emacs.d/config/init-astro.el b/emacs/.emacs.d/config/init-astro.el index b4db2fd..2d7b73f 100644 --- a/emacs/.emacs.d/config/init-astro.el +++ b/emacs/.emacs.d/config/init-astro.el @@ -1,14 +1,6 @@ ;; -*- lexical-binding: t; -*- -(use-package astro-ts-mode - :mode "\\.astro\\'" - :init - (with-eval-after-load 'treesit - (add-to-list 'treesit-language-source-alist - '(astro "https://github.com/virchau13/tree-sitter-astro")) - (add-to-list 'treesit-language-source-alist - '(css "https://github.com/tree-sitter/tree-sitter-css")) - (add-to-list 'treesit-language-source-alist - '(tsx "https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")))) +(define-derived-mode astro-mode web-mode "astro") +(add-to-list 'auto-mode-alist '("\\.astro\\'" . astro-mode)) (provide 'init-astro) diff --git a/emacs/.emacs.d/config/init-ide.el b/emacs/.emacs.d/config/init-ide.el index f5a8959..8e84ba6 100644 --- a/emacs/.emacs.d/config/init-ide.el +++ b/emacs/.emacs.d/config/init-ide.el @@ -92,9 +92,9 @@ ;; Astro (add-to-list 'eglot-server-programs - '(astro-ts-mode . ("astro-ls" "--stdio" - :initializationOptions - (:typescript (:tsdk "./node_modules/typescript/lib"))))) + '(astro-mode . ("astro-ls" "--stdio" + :initializationOptions + (:typescript (:tsdk "./node_modules/typescript/lib"))))) ;; Custom eglot java server for deeper customization (defvar eglot-java-java-agent nil @@ -235,7 +235,7 @@ (ruby-ts-mode . eglot-ensure) (sh-mode . eglot-ensure) (bash-ts-mode . eglot-ensure) - (astro-ts-mode . eglot-ensure) + (astro-mode . eglot-ensure) :custom (eglot-confirm-server-initiated-edits nil) (eglot-connect-timeout nil))