Skip to content

Commit eb5a82c

Browse files
authored
docs: update nvim guide (#4984)
1 parent 4d7d8bf commit eb5a82c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
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`.
3636

37+
> 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`
38+
3739
```lua
3840
-- If you are using mason.nvim, you can get the ts_plugin_path like this
3941
-- local mason_registry = require('mason-registry')
@@ -43,7 +45,7 @@ local vue_language_server_path = '/path/to/@vue/language-server'
4345

4446
local lspconfig = require('lspconfig')
4547

46-
lspconfig.tsserver.setup {
48+
lspconfig.ts_ls.setup {
4749
init_options = {
4850
plugins = {
4951
{
@@ -62,7 +64,7 @@ lspconfig.volar.setup {}
6264

6365
### Non-Hybrid mode(similar to takeover mode) configuration (Requires `@vue/language-server` version `^2.0.7`)
6466

65-
Note: If `hybridMode` is set to `false` `Volar` will run embedded `tsserver` therefore there is no need to run it separately.
67+
Note: If `hybridMode` is set to `false` `Volar` will run embedded `ts_ls` therefore there is no need to run it separately.
6668

6769
For more information see [#4119](https://github.com/vuejs/language-tools/pull/4119)
6870

@@ -72,7 +74,7 @@ Use volar for all `.{vue,js,ts,tsx,jsx}` files.
7274
```lua
7375
local lspconfig = require('lspconfig')
7476

75-
-- lspconfig.tsserver.setup {}
77+
-- lspconfig.ts_ls.setup {}
7678
lspconfig.volar.setup {
7779
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
7880
init_options = {
@@ -83,11 +85,11 @@ lspconfig.volar.setup {
8385
}
8486
```
8587

86-
Use `volar` for only `.vue` files and `tsserver` for `.ts` and `.js` files.
88+
Use `volar` for only `.vue` files and `ts_ls` for `.ts` and `.js` files.
8789
```lua
8890
local lspconfig = require('lspconfig')
8991

90-
lspconfig.tsserver.setup {
92+
lspconfig.ts_ls.setup {
9193
init_options = {
9294
plugins = {
9395
{

0 commit comments

Comments
 (0)