1. vue-language-server
vue-language-server
vue-language-server
Package: vue-language-server
Created by: vuejs
Last modified: Tue, 28 Jun 2022 19:45:57 GMT
Version: 0.0.67
License: MIT
Downloads: 3,045
Repository: https://github.com/vuejs/vetur

Install

npm install vue-language-server
yarn add vue-language-server

Vue Language Server

vue-language-server is a language server implementation compatible with language-server-protocol.

Vetur is the VS Code client consuming vue-language-server.

It's possible for other language-server-protocol compatible editors to build language server clients that consume VLS.

Usage

There are two ways to integrate vue-language-server into editors:

  1. As a global executable.

Example Client: https://github.com/autozimu/LanguageClient-neovim

First, install VLS globally.

 npm install vue-language-server -g

This will provide you the global vls command.

Then, configure LanguageClient to use vls. In this example, we write below configuration into init.vim.

 let g:LanguageClient_serverCommands = {
    \ 'vue': ['vls']
    \ }
  1. As a plugin dependency.

Example: https://github.com/HerringtonDarkholme/atom-vue

First, install vue-language-server as a local dependency.

 npm install vue-language-server --save

Then, require the vue-language-server, this would typically look like:

 class VueLanguageClient extends AutoLanguageClient {
  startServerProcess () {
    return cp.spawn('node', [require.resolve('vue-language-server/dist/htmlServerMain')])
  }
}
  1. As extension of coc.nvim

Install coc.nvim in your vim/neovim.

Then, run vim command

:CocInstall coc-vetur

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin