Add mdx lsp support

This commit is contained in:
2026-04-27 11:57:14 -07:00
parent 051ea08678
commit 5a3a28badc
6 changed files with 115 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
return {
cmd = { "lemminx" },
filetypes = { "xml", "xsd", "xsl", "xslt", "svg" },
root_markers = { "sfdx-project.json", ".git" },
}
+7
View File
@@ -0,0 +1,7 @@
-- LWC LSP: install with `npm i -g @salesforce/lwc-language-server`.
-- Attaches only inside SFDX projects via root marker.
return {
cmd = { "lwc-language-server", "--stdio" },
filetypes = { "javascript", "html" },
root_markers = { "sfdx-project.json" },
}
+24
View File
@@ -0,0 +1,24 @@
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 },
},
},
}