Skip to content

Commit 8861252

Browse files
authored
Add download-server-fn for astro-ls (#4414)
Allow Astro support to download with M-x lsp-install-server
1 parent cde52c8 commit 8861252

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

clients/lsp-astro.el

+10-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
;;; Commentary:
2222

23-
;; client for astro-ls
23+
;; LSP client for astro-ls
2424

2525
;;; Code:
2626

@@ -38,11 +38,19 @@
3838
:group 'lsp-mode
3939
:link '(url-link "https://github.com/withastro/language-tools"))
4040

41+
(lsp-dependency 'astro-language-server
42+
'(:system "astroserver")
43+
'(:npm :package "@astrojs/language-server"
44+
:path "astroserver"))
45+
46+
4147
(lsp-register-client
4248
(make-lsp-client :new-connection (lsp-stdio-connection '("astro-ls" "--stdio"))
4349
:activation-fn (lsp-activate-on "astro")
4450
:initialization-options #'lsp-astro--get-initialization-options
45-
:server-id 'astro-ls))
51+
:server-id 'astro-ls
52+
:download-server-fn (lambda (_client callback error-callback _update?)
53+
(lsp-package-ensure 'astro-language-server callback error-callback))))
4654

4755
(lsp-consistency-check lsp-astro)
4856

0 commit comments

Comments
 (0)