Open selrond opened 5 years ago
Hopefully. I'm very new to VS Code hacking, but I'll give it a shot some time.
Yeah this would be a great addition to the plugin.
I appreciate the effort it would require to make it possible.
I wish I had free time to contribute to this, as I think intellisense support will become crucial as MDX uptake increases with Storybook.
I'm already heavily missing it, but the plugin as is has helped my workflow a lot already, so thank you.
Thank you for the kind words, and I totally agree, MDX is going places.
Btw, I just want everyone to know that the inactivity in this repo is only temporary, I'm still heavily using it and I plan to make it much better.
Does "intellisense" also include stuff like "import autocomplete"? Currently it's hard to import things into .mdx
files, because no popup shows up to assist in importing.
For me, I think v1 of intellisense would be just pulling in things like props, etc. For example, if I do <Grid justifyContent="" />
using MUI, it'd be nice if it gave me available options for justifyContent.
The html implementation for script tags could be a starting point https://github.com/microsoft/vscode/blob/8f08c2ffa75e9ca53ac8ef67ff023feeb94fe5fc/extensions/html-language-features/server/src/modes/javascriptMode.ts
The idea is to convert the current MDX file to a js file, converting everything that is not js to an empty line (this way maintaining the typescript rages correct), then send it to the typescript language server host to get the completion results
Thanks for the tip!
I guess @remorses tip also mirrors the comment from @mjbvz here: https://github.com/microsoft/vscode/issues/92805#issuecomment-599852139
Another thing mentioned over there is that vuejs/vetur
is also a really good reference for doing this.
And also, that "this won't be easy" :)
Hey, any updates on this feature request?
Friendly ping to @silvenon 🛎 ... sorry to bug you but wondering if this is still in the works. This would be a huuuge help if it were available. I have a project where I'm writing MDX content with react components that take complicated props. It would be fantastic to get autocomplete / type-checking on the props.
This is a blog post with some text... now I'll show you my **interactive component**
<InteractiveThing aPropWhatGoesHereIForget={"help!"} />
Seems like this is also an issue over at mdx-js/vscode-mdx
, which seems like it could be possibly more regularly maintained:
Would it be possible to have intellisense for javascript and markdown inside
.mdx
files? It would require custom rules / config probably. I'm not aware how it works though...