Use web-mode for astro
This commit is contained in:
parent
73227abcbe
commit
6352fbb697
@ -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)
|
||||||
|
@ -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))
|
||||||
|
Loading…
Reference in New Issue
Block a user