aboutsummaryrefslogtreecommitdiffstats
path: root/lsp/mdx_analyzer.lua
diff options
context:
space:
mode:
authorAlexis Tacnet <alexistacnet@gmail.com>2025-04-28 14:11:00 +0200
committerGitHub <noreply@github.com>2025-04-28 05:11:00 -0700
commit9c6bbb5d1125491c7c7547e15188ae3e42647143 (patch)
treea1cbe79cc352595db07c188a577802e5aaab3630 /lsp/mdx_analyzer.lua
parentci: check legacy configs *last* #3797 (diff)
downloadnvim-lspconfig-9c6bbb5d1125491c7c7547e15188ae3e42647143.tar
nvim-lspconfig-9c6bbb5d1125491c7c7547e15188ae3e42647143.tar.gz
nvim-lspconfig-9c6bbb5d1125491c7c7547e15188ae3e42647143.tar.bz2
nvim-lspconfig-9c6bbb5d1125491c7c7547e15188ae3e42647143.tar.lz
nvim-lspconfig-9c6bbb5d1125491c7c7547e15188ae3e42647143.tar.xz
nvim-lspconfig-9c6bbb5d1125491c7c7547e15188ae3e42647143.tar.zst
nvim-lspconfig-9c6bbb5d1125491c7c7547e15188ae3e42647143.zip
fix: improve typescript server path search for ts-dependent lsp #3795
Diffstat (limited to 'lsp/mdx_analyzer.lua')
-rw-r--r--lsp/mdx_analyzer.lua7
1 files changed, 2 insertions, 5 deletions
diff --git a/lsp/mdx_analyzer.lua b/lsp/mdx_analyzer.lua
index 0eb5a008..ce87f538 100644
--- a/lsp/mdx_analyzer.lua
+++ b/lsp/mdx_analyzer.lua
@@ -3,10 +3,7 @@
---
--- `mdx-analyzer`, a language server for MDX
-local function get_typescript_server_path(root_dir)
- local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1])
- return project_root and vim.fs.joinpath(project_root, 'node_modules', 'typescript', 'lib') or ''
-end
+local util = require 'lspconfig.util'
return {
cmd = { 'mdx-language-server', '--stdio' },
@@ -18,7 +15,7 @@ return {
},
before_init = function(_, config)
if config.init_options and config.init_options.typescript and not config.init_options.typescript.tsdk then
- config.init_options.typescript.tsdk = get_typescript_server_path(config.root_dir)
+ config.init_options.typescript.tsdk = util.get_typescript_server_path(config.root_dir)
end
end,
}