The Emacs lsp-mode client for vue LSP v3.
Add lsp-vue
and lsp-vtsls (vue LSP currently only work with vtsls):
;; packages.el
(package! lsp-vue :recipe (:host github :repo "sdvcrx/lsp-vue"))
(package! lsp-vtsls :recipe (:host github :repo "sdvcrx/lsp-vtsls"))
;; config.el
(use-package! lsp-vue
:after lsp-mode
:config
(setq lsp-vtsls-typescript-global-plugins
(vector
(list :name "@vue/typescript-plugin"
:location (f-join (lsp-package-path 'vue-language-server) "../.." "lib/node_modules/@vue/language-server/")
:languages (vector "vue")
:configNamespace "typescript"
:enableForWorkspaceTypeScriptVersions t))))
(use-package! lsp-vtsls
:after lsp-mode
:config
(add-to-list 'lsp-vtsls-activate-languages "vue")
(setq
;; show all LSP doc on minibuffer
lsp-eldoc-render-all t
;; https://github.com/yioneko/vtsls#bad-performance-of-completion
lsp-vtsls-server-side-fuzzy-match t
lsp-vtsls-entries-limit 10))
Install vue
LSP:
M+x lsp-install-server
then selectvue-ls
(andvtsls
) .