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; -*-
(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)

View File

@ -92,7 +92,7 @@
;; Astro
(add-to-list 'eglot-server-programs
'(astro-ts-mode . ("astro-ls" "--stdio"
'(astro-mode . ("astro-ls" "--stdio"
:initializationOptions
(:typescript (:tsdk "./node_modules/typescript/lib")))))
@ -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))