aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorMichael Härtl <haertl.mike@gmail.com>2022-10-26 13:01:49 +0200
committerGitHub <noreply@github.com>2022-10-26 19:01:49 +0800
commitc31e977e7395b05e2ac14610e17ba347df7a0d27 (patch)
treec44351c280a32ab26002e847d0d67113166fb456 /lua
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-c31e977e7395b05e2ac14610e17ba347df7a0d27.tar
nvim-lspconfig-c31e977e7395b05e2ac14610e17ba347df7a0d27.tar.gz
nvim-lspconfig-c31e977e7395b05e2ac14610e17ba347df7a0d27.tar.bz2
nvim-lspconfig-c31e977e7395b05e2ac14610e17ba347df7a0d27.tar.lz
nvim-lspconfig-c31e977e7395b05e2ac14610e17ba347df7a0d27.tar.xz
nvim-lspconfig-c31e977e7395b05e2ac14610e17ba347df7a0d27.tar.zst
nvim-lspconfig-c31e977e7395b05e2ac14610e17ba347df7a0d27.zip
fix(volar): update example for volar 1.0 (#2219)
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/server_configurations/volar.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/lua/lspconfig/server_configurations/volar.lua b/lua/lspconfig/server_configurations/volar.lua
index 64c6a414..a7f38ade 100644
--- a/lua/lspconfig/server_configurations/volar.lua
+++ b/lua/lspconfig/server_configurations/volar.lua
@@ -106,9 +106,9 @@ e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are
require'lspconfig'.volar.setup{
init_options = {
typescript = {
- serverPath = '/path/to/.npm/lib/node_modules/typescript/lib/tsserverlib.js'
+ tsdk = '/path/to/.npm/lib/node_modules/typescript/lib'
-- Alternative location if installed as root:
- -- serverPath = '/usr/local/lib/node_modules/typescript/lib/tsserverlibrary.js'
+ -- tsdk = '/usr/local/lib/node_modules/typescript/lib'
}
}
}
@@ -120,12 +120,12 @@ require'lspconfig'.volar.setup{
local util = require 'lspconfig.util'
local function get_typescript_server_path(root_dir)
- local global_ts = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib/tsserverlibrary.js'
+ local global_ts = '/home/[yourusernamehere]/.npm/lib/node_modules/typescript/lib'
-- Alternative location if installed as root:
- -- local global_ts = '/usr/local/lib/node_modules/typescript/lib/tsserverlibrary.js'
+ -- local global_ts = '/usr/local/lib/node_modules/typescript/lib'
local found_ts = ''
local function check_dir(path)
- found_ts = util.path.join(path, 'node_modules', 'typescript', 'lib', 'tsserverlibrary.js')
+ found_ts = util.path.join(path, 'node_modules', 'typescript', 'lib')
if util.path.exists(found_ts) then
return path
end
@@ -139,7 +139,7 @@ end
require'lspconfig'.volar.setup{
on_new_config = function(new_config, new_root_dir)
- new_config.init_options.typescript.serverPath = get_typescript_server_path(new_root_dir)
+ new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir)
end,
}
```