silvenon / vscode-mdx

MDX for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=silvenon.mdx
MIT License
110 stars 9 forks source link

Intellisense not working #8

Open selrond opened 5 years ago

selrond commented 5 years ago

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

silvenon commented 5 years ago

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

chrispaynter commented 5 years ago

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.

silvenon commented 5 years ago

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.

piotrpalek commented 5 years ago

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.

riceboyler commented 4 years ago

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.

remorses commented 4 years ago

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

silvenon commented 4 years ago

Thanks for the tip!

karlhorky commented 4 years ago

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

jasongerbes commented 4 years ago

Hey, any updates on this feature request?

adueck commented 3 years ago

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!"} />
karlhorky commented 3 years ago

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