From a180ddb7e5a89af3c4b204fa5a5e05579b20267b Mon Sep 17 00:00:00 2001 From: D3monizer Date: Mon, 4 Nov 2024 14:25:13 +0300 Subject: [PATCH 1/2] Replace tsserver with ts_ls Add note for legacy lspconfig versions and provide release link --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 182573c9e7..755b1de9fa 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,9 @@ Note: The "Take Over" mode has been discontinued. Instead, a new "Hybrid" mode has been introduced. In this mode, the Vue Language Server exclusively manages the CSS/HTML sections. As a result, you must run `@vue/language-server` in conjunction with a TypeScript server that employs `@vue/typescript-plugin`. Below is a streamlined configuration for Neovim's LSP, updated to accommodate the language server following the upgrade to version `2.0.0`. +> [!NOTE] +> For nvim-lspconfig versions below [v1.0.0](https://newreleases.io/project/github/neovim/nvim-lspconfig/release/v1.0.0) use tsserver instead of ts_ls, e.g. `lspconfig.ts_ls.setup` + ```lua -- If you are using mason.nvim, you can get the ts_plugin_path like this -- local mason_registry = require('mason-registry') @@ -43,7 +46,7 @@ local vue_language_server_path = '/path/to/@vue/language-server' local lspconfig = require('lspconfig') -lspconfig.tsserver.setup { +lspconfig.ts_ls.setup { init_options = { plugins = { { @@ -62,7 +65,7 @@ lspconfig.volar.setup {} ### Non-Hybrid mode(similar to takeover mode) configuration (Requires `@vue/language-server` version `^2.0.7`) -Note: If `hybridMode` is set to `false` `Volar` will run embedded `tsserver` therefore there is no need to run it separately. +Note: If `hybridMode` is set to `false` `Volar` will run embedded `ts_ls` therefore there is no need to run it separately. For more information see [#4119](https://github.com/vuejs/language-tools/pull/4119) @@ -72,7 +75,7 @@ Use volar for all `.{vue,js,ts,tsx,jsx}` files. ```lua local lspconfig = require('lspconfig') --- lspconfig.tsserver.setup {} +-- lspconfig.ts_ls.setup {} lspconfig.volar.setup { filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }, init_options = { @@ -83,11 +86,11 @@ lspconfig.volar.setup { } ``` -Use `volar` for only `.vue` files and `tsserver` for `.ts` and `.js` files. +Use `volar` for only `.vue` files and `ts_ls` for `.ts` and `.js` files. ```lua local lspconfig = require('lspconfig') -lspconfig.tsserver.setup { +lspconfig.ts_ls.setup { init_options = { plugins = { { From a0dcf9c17a140a1c6d5be10d9ab9ac24f21e6c40 Mon Sep 17 00:00:00 2001 From: ZeroMask Date: Mon, 4 Nov 2024 14:31:14 +0300 Subject: [PATCH 2/2] Update README.md Fix notes in details tag --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 755b1de9fa..d00e4bffc3 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,6 @@ Note: The "Take Over" mode has been discontinued. Instead, a new "Hybrid" mode has been introduced. In this mode, the Vue Language Server exclusively manages the CSS/HTML sections. As a result, you must run `@vue/language-server` in conjunction with a TypeScript server that employs `@vue/typescript-plugin`. Below is a streamlined configuration for Neovim's LSP, updated to accommodate the language server following the upgrade to version `2.0.0`. -> [!NOTE] > For nvim-lspconfig versions below [v1.0.0](https://newreleases.io/project/github/neovim/nvim-lspconfig/release/v1.0.0) use tsserver instead of ts_ls, e.g. `lspconfig.ts_ls.setup` ```lua