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

Auto complete of props in MDC

Open atinux opened this issue 2 years ago • 4 comments

It would be great to have the possibility to support the autocompletion of props in the editor.

atinux avatar Jun 16 '22 13:06 atinux

I guess we could leverage something similar to what @tahul has done in Pinceau: https://github.com/Tahul/pinceau/blob/main/volar/index.js

By using nuxt-component-meta under the hood?

atinux avatar Sep 14 '22 10:09 atinux

I was wanting to implement autocomplete for my React project at work. I was planning to have auto complete of props as well as directive names by reading the filenames of MDC directive components.

Would it be possible to have a configuration file that can specify all the props available for each directive so that this could work in a React as well as Vue project?

mrwwalmsley avatar Oct 13 '22 22:10 mrwwalmsley

Did you make the MDC works with React @mrwwalmsley ?

atinux avatar Oct 19 '22 08:10 atinux

Yes, we have been using MDC in a React project for a couple of years -- we extended Remark's MDC implementation.

We had own custom editor & syntax highlighting that was not as good as the Nuxt3 syntax highlighter. When Nuxt3 added MDC I started upgrading my Nuxt side projects from Nuxt2 to Nuxt3 using MDC. After that we started testing the Nuxt plugin for writing our React content in VsCode.

Our MDC implementation has a bunch of custom extensions such as include and define statements:

:::define[template_name]
Hello {{name}}!
:::

:::include[template_name]
name='Mike'
:::

:::include[template_name]
name='Sebastian'
:::

If the includes are not defined locally, then they are loaded from our content DB.

mrwwalmsley avatar Nov 17 '22 04:11 mrwwalmsley

I've been using this extension for a Nuxt website I have been rebuilding from Options+Nuxt2 to Composition+Nuxt3. It would be amazing to get autocomplete and syntax highlighting for attributes as well as slot names:

image

And ideally would give a red squiggly underline for slots or attributes that don't exist. This would make it much easier for content writers.

How hard to do this? Anything I can do to help?

mrwwalmsley avatar Oct 12 '24 11:10 mrwwalmsley