Open bencmbrook opened 3 months ago
MDX and markdown are definitely different, and there is already vscode-mdx
.
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.
Hi! Thanks for reaching out! Because we treat issues as our backlog, we close issues that are questions since they don’t represent a task to be completed.
See our support docs for how and where to ask questions.
Thanks, — bb
vscode-mdx
provides MDX language support. I would also like to see unified-engine
based remark support for MDX.
Related issues:
I think those issues need to be resolved first. Then we can investigate support in remark-language-server
/ vscode-remark
. We can implement something like probing in vscode-eslint
.
Hi team! I don’t know what’s up as there’s no phase label. Please add one so I know where it’s at.
Thanks, — bb
Thank you! Yes my use-case is aligned to that @remcohaszing — showing our remark lint issues in MDX files with IntelliSense.
Our workaround works perfectly today for linting MDX with vscode-remark (by using remark-mdx in our .remarkrc
file and forcing VS Code to treat MDX as Markdown via "files.associations"
) but it comes at the tradeoff of the vscode-mdx extension no longer recognizing the file, since it's treated as Markdown.
@remcohaszing given the extension works with MDX in our workaround... in theory, would updating this to simply include MDX files work? https://github.com/remarkjs/vscode-remark/blob/a6b066c1c3df19e59de4de49152c878d8104264a/src/extension.js#L17 Ideally there would be an exposed setting as well that toggles that so it's opt-in. Also understand if you prefer to go with the more foundational work of handling rule overrides.
Cf https://github.com/orgs/mdx-js/discussions/2067#discussioncomment-3023340
Remark-cli and thus remark-vscode are the recommended tools to format MDX
Cf https://github.com/orgs/mdx-js/discussions/2067#discussioncomment-3023340
Remark-cli and thus remark-vscode are the recommended tools to format MDX
Yeah I'm using that for CLI formatting today, but this issue is primarily about highlighting lint errors in the same way that Prettier would, like so:
This is forcebly enabled for MDX in my VSCode via the method described in the Alternatives section in the issue. And these rules are specified via .remarkrc
, which includes the remark-vscode
plugin
Initial checklist
Problem
vscode-remark only recognizes markdown files https://github.com/remarkjs/vscode-remark/blob/a6b066c1c3df19e59de4de49152c878d8104264a/src/extension.js#L17
but there is now a dedicated MDX language in VS Code. it would be awesome if we could use remark lint on our MDX files!
Solution
Update the documentSelector to include MDX files
Alternatives
You can force VS Code to treat MDX as Markdown, which allows vscode-remark to work, but it comes at the cost of all the other language features of MDX in VS Code via vscode-mdx