Skip to content

Commit

Permalink
Add download-server-fn for astro-ls (#4414)
Browse files Browse the repository at this point in the history
Allow Astro support to download with M-x lsp-install-server
  • Loading branch information
komali2 committed Apr 3, 2024
1 parent cde52c8 commit 8861252
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions clients/lsp-astro.el
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

;;; Commentary:

;; client for astro-ls
;; LSP client for astro-ls

;;; Code:

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

(lsp-dependency 'astro-language-server
'(:system "astroserver")
'(:npm :package "@astrojs/language-server"
:path "astroserver"))


(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection '("astro-ls" "--stdio"))
:activation-fn (lsp-activate-on "astro")
:initialization-options #'lsp-astro--get-initialization-options
:server-id 'astro-ls))
:server-id 'astro-ls
:download-server-fn (lambda (_client callback error-callback _update?)
(lsp-package-ensure 'astro-language-server callback error-callback))))

(lsp-consistency-check lsp-astro)

Expand Down

0 comments on commit 8861252

Please sign in to comment.