diff --git a/lua/lspconfig/server_configurations/volar.lua b/lua/lspconfig/server_configurations/volar.lua index 64c6a41485..a7f38ade88 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, } ```