aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/volar.lua
diff options
context:
space:
mode:
authorJ.c <Jak-Ch-ll@mailbox.org>2025-05-10 13:56:36 +0200
committerJ.c <Jak-Ch-ll@mailbox.org>2025-05-11 15:54:13 +0200
commit221bc7bd182c78453c67db34e4bc465dc13612d4 (patch)
tree777fa4e1af83081232497cad407ca139f64a61a3 /lsp/volar.lua
parentdocs: cleanup (diff)
downloadnvim-lspconfig-221bc7bd182c78453c67db34e4bc465dc13612d4.tar
nvim-lspconfig-221bc7bd182c78453c67db34e4bc465dc13612d4.tar.gz
nvim-lspconfig-221bc7bd182c78453c67db34e4bc465dc13612d4.tar.bz2
nvim-lspconfig-221bc7bd182c78453c67db34e4bc465dc13612d4.tar.lz
nvim-lspconfig-221bc7bd182c78453c67db34e4bc465dc13612d4.tar.xz
nvim-lspconfig-221bc7bd182c78453c67db34e4bc465dc13612d4.tar.zst
nvim-lspconfig-221bc7bd182c78453c67db34e4bc465dc13612d4.zip
feat(volar)!: rename to 'vue_ls'
The Vue language tooling does not use 'Volar' prominently in its documentation. The official name for the language server is '@vue/language-server'.
Diffstat (limited to 'lsp/volar.lua')
-rw-r--r--lsp/volar.lua93
1 files changed, 3 insertions, 90 deletions
diff --git a/lsp/volar.lua b/lsp/volar.lua
index bd8006cc..bfa4bc9a 100644
--- a/lsp/volar.lua
+++ b/lsp/volar.lua
@@ -1,95 +1,8 @@
---@brief
---
---- https://github.com/vuejs/language-tools/tree/master/packages/language-server
+--- Renamed to [vue_ls](#vue_ls)
---
---- Volar language server for Vue
---
---- Volar can be installed via npm:
---- ```sh
---- npm install -g @vue/language-server
---- ```
----
---- Volar by default supports Vue 3 projects.
---- For Vue 2 projects, [additional configuration](https://github.com/vuejs/language-tools/blob/master/extensions/vscode/README.md?plain=1#L19) are required.
----
---- **Hybrid Mode (by default)**
----
---- In this mode, the Vue Language Server exclusively manages the CSS/HTML sections.
---- You need the `ts_ls` server with the `@vue/typescript-plugin` plugin to support TypeScript in `.vue` files.
---- See `ts_ls` section for more information
----
---- **No Hybrid Mode**
----
---- Volar will run embedded `ts_ls` therefore there is no need to run it separately.
---- ```lua
---- local lspconfig = require('lspconfig')
----
---- vim.lsp.config('volar', {
---- -- add filetypes for typescript, javascript and vue
---- filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
---- init_options = {
---- vue = {
---- -- disable hybrid mode
---- hybridMode = false,
---- },
---- },
---- })
---- -- you must remove "ts_ls" config
---- -- vim.lsp.config['ts_ls'] = {}
---- ```
----
---- **Overriding the default TypeScript Server used by Volar**
----
---- The default config looks for TypeScript in the local `node_modules`. This can lead to issues
---- e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are:
----
---- - use a global TypeScript Server installation
---- ```lua
---- vim.lsp.config('volar', {
---- init_options = {
---- typescript = {
---- -- replace with your global TypeScript library path
---- tsdk = '/path/to/node_modules/typescript/lib'
---- }
---- }
---- })
---- ```
----
---- - use a local server and fall back to a global TypeScript Server installation
---- ```lua
---- vim.lsp.config('volar', {
---- init_options = {
---- typescript = {
---- -- replace with your global TypeScript library path
---- tsdk = '/path/to/node_modules/typescript/lib'
---- }
---- },
---- before_init = function(params, config)
---- local lib_path = vim.fs.find('node_modules/typescript/lib', { path = new_root_dir, upward = true })[1]
---- if lib_path then
---- config.init_options.typescript.tsdk = lib_path
---- end
---- end
---- })
---- ```
-
-local util = require 'lspconfig.util'
-
--- https://github.com/vuejs/language-tools/blob/master/packages/language-server/lib/types.ts
-local volar_init_options = {
- typescript = {
- tsdk = '',
- },
-}
+vim.deprecate('volar', 'vue_ls', '3.0.0', 'lspconfig', false)
-return {
- cmd = { 'vue-language-server', '--stdio' },
- filetypes = { 'vue' },
- root_markers = { 'package.json' },
- init_options = volar_init_options,
- before_init = function(_, config)
- if config.init_options and config.init_options.typescript and config.init_options.typescript.tsdk == '' then
- config.init_options.typescript.tsdk = util.get_typescript_server_path(config.root_dir)
- end
- end,
-}
+return vim.lsp.config.vue_ls