sanny-lsp-vim v0.4.1
Vue Language Server
Vue Language Server (vls
) is a language server implementation compatible with language-server-protocol
.
Vetur is the VS Code client consuming vls
.
It's possible for other LSP compatible editors to build language server clients that consume vls
.
Usage
There are two ways to integrate vls
into editors:
As a global executable.
Example Client: https://github.com/autozimu/LanguageClient-neovim
First, install VLS globally.
npm install vls -g
This will provide you the global
vls
command.Then, configure LanguageClient to use
vls
. In this example, we write below configuration intoinit.vim
.
let g:LanguageClient_serverCommands = {
\ 'vue': ['vls']
\ }
As a plugin dependency.
Example: https://github.com/HerringtonDarkholme/atom-vue
First, install vls as a local dependency.
npm install vls --save
Then, require the vls, this would typically look like:
class VueLanguageClient extends AutoLanguageClient { startServerProcess () { return cp.spawn('node', [require.resolve('vls/dist/htmlServerMain')]) } }
As extension of coc.nvim
Install coc.nvim in your vim/neovim.
Then, run vim command
:CocInstall coc-vetur
2 years ago