diff --git a/lua/lspconfig/configs/mdx_analyzer.lua b/lua/lspconfig/configs/mdx_analyzer.lua index 37948d2369..6ae65a2bda 100644 --- a/lua/lspconfig/configs/mdx_analyzer.lua +++ b/lua/lspconfig/configs/mdx_analyzer.lua @@ -1,14 +1,14 @@ local util = require 'lspconfig.util' local function get_typescript_server_path(root_dir) - local project_root = vim.fs.find('node_modules', { path = root_dir, upward = true })[1] + local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1]) return project_root and (project_root .. '/node_modules/typescript/lib') or '' end return { default_config = { cmd = { 'mdx-language-server', '--stdio' }, - filetypes = { 'markdown.mdx' }, + filetypes = { 'mdx' }, root_dir = util.root_pattern 'package.json', single_file_support = true, settings = {},