Skip to content

Commit

Permalink
Auto install of the html language server
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan authored and yyoncho committed Feb 29, 2020
1 parent 232c33e commit 3dd5ced
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions lsp-html.el
Original file line number Diff line number Diff line change
Expand Up @@ -161,23 +161,34 @@ styles."
("html.format.enable" lsp-html-format-enable t)
("html.experimental.customData" lsp-html-experimental-custom-data)))

(defcustom lsp-html-server-command '("html-languageserver" "--stdio")
(defcustom lsp-html-server-command-args '("--stdio")
"Command to start html-languageserver."
:type '(repeat string)
:group 'lsp-html
:package-version '(lsp-mode . "6.1"))
:package-version '(lsp-mode . "6.3"))

(lsp-dependency 'html-language-server
'(:system "html-languageserver")
'(:npm :package "vscode-html-languageserver-bin"
:path "html-languageserver"))

(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection
(lambda () lsp-html-server-command))
(lambda ()
(cons (lsp-package-path 'html-language-server)
lsp-html-server-command-args)))
:major-modes '(html-mode sgml-mode mhtml-mode web-mode)
:priority -4
:completion-in-comments? t
:server-id 'html-ls
:initialized-fn (lambda (w)
(with-lsp-workspace w
(lsp--set-configuration
(lsp-configuration-section "html"))))))
(lsp-configuration-section "html"))))
:download-server-fn (lambda (_client callback error-callback _update?)
(lsp-package-ensure
'html-language-server callback
error-callback))))

(provide 'lsp-html)
;;; lsp-html.el ends here
Expand Down

0 comments on commit 3dd5ced

Please sign in to comment.