25 lines
660 B
Lua
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 },
|
|
},
|
|
},
|
|
}
|