Files
neovimrc/lsp/mdx_analyzer.lua
T
2026-04-27 11:57:14 -07:00

25 lines
660 B
Lua

local function tsdk()
local local_ts = vim.fs.find("node_modules/typescript/lib", {
upward = true,
path = vim.fn.expand("%:p:h"),
type = "directory",
})[1]
if local_ts then return local_ts end
return vim.fn.stdpath("data")
.. "/mason/packages/typescript-language-server/node_modules/typescript/lib"
end
return {
cmd = { "mdx-language-server", "--stdio" },
filetypes = { "mdx", "markdown.mdx" },
root_markers = { "package.json", "tsconfig.json", ".git" },
init_options = {
typescript = { tsdk = tsdk() },
},
capabilities = {
workspace = {
didChangeWatchedFiles = { dynamicRegistration = false },
},
},
}