Use web-mode for astro

This commit is contained in:
Jeremy Dormitzer 2024-09-19 10:39:40 -04:00
parent 73227abcbe
commit 6352fbb697
2 changed files with 6 additions and 14 deletions

View File

@ -1,14 +1,6 @@
;; -*- lexical-binding: t; -*- ;; -*- lexical-binding: t; -*-
(use-package astro-ts-mode (define-derived-mode astro-mode web-mode "astro")
:mode "\\.astro\\'" (add-to-list 'auto-mode-alist '("\\.astro\\'" . astro-mode))
: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"))))
(provide 'init-astro) (provide 'init-astro)

View File

@ -92,9 +92,9 @@
;; Astro ;; Astro
(add-to-list 'eglot-server-programs (add-to-list 'eglot-server-programs
'(astro-ts-mode . ("astro-ls" "--stdio" '(astro-mode . ("astro-ls" "--stdio"
:initializationOptions :initializationOptions
(:typescript (:tsdk "./node_modules/typescript/lib"))))) (:typescript (:tsdk "./node_modules/typescript/lib")))))
;; Custom eglot java server for deeper customization ;; Custom eglot java server for deeper customization
(defvar eglot-java-java-agent nil (defvar eglot-java-java-agent nil
@ -235,7 +235,7 @@
(ruby-ts-mode . eglot-ensure) (ruby-ts-mode . eglot-ensure)
(sh-mode . eglot-ensure) (sh-mode . eglot-ensure)
(bash-ts-mode . eglot-ensure) (bash-ts-mode . eglot-ensure)
(astro-ts-mode . eglot-ensure) (astro-mode . eglot-ensure)
:custom :custom
(eglot-confirm-server-initiated-edits nil) (eglot-confirm-server-initiated-edits nil)
(eglot-connect-timeout nil)) (eglot-connect-timeout nil))