vscode-mdx icon indicating copy to clipboard operation
vscode-mdx copied to clipboard

Intellisense not working

Open selrond opened this issue 6 years ago • 11 comments

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...

selrond avatar Jan 09 '19 09:01 selrond

Hopefully. I'm very new to VS Code hacking, but I'll give it a shot some time.

silvenon avatar Jan 09 '19 10:01 silvenon

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.

chrispaynter avatar Sep 25 '19 09:09 chrispaynter

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.

silvenon avatar Sep 26 '19 17:09 silvenon

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.

piotrpalek avatar Oct 24 '19 14:10 piotrpalek

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.

riceboyler avatar Nov 15 '19 22:11 riceboyler

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

remorses avatar Jun 06 '20 13:06 remorses

Thanks for the tip!

silvenon avatar Jun 06 '20 16:06 silvenon

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" :)

karlhorky avatar Jul 01 '20 11:07 karlhorky

Hey, any updates on this feature request?

jasongerbes avatar Oct 07 '20 00:10 jasongerbes

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!"} />

adueck avatar Jan 21 '21 14:01 adueck

Seems like this is also an issue over at mdx-js/vscode-mdx, which seems like it could be possibly more regularly maintained:

https://github.com/mdx-js/vscode-mdx/issues/165

karlhorky avatar Mar 28 '21 17:03 karlhorky