Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto complete of props in MDC #24

Open
atinux opened this issue Jun 16, 2022 · 5 comments
Open

Auto complete of props in MDC #24

atinux opened this issue Jun 16, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@atinux
Copy link
Member

atinux commented Jun 16, 2022

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

@atinux atinux added the enhancement New feature or request label Jun 16, 2022
Copy link
Member Author

atinux commented Sep 14, 2022

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?

@mrwwalmsley
Copy link

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?

Copy link
Member Author

atinux commented Oct 19, 2022

Did you make the MDC works with React @mrwwalmsley ?

@mrwwalmsley
Copy link

mrwwalmsley commented Nov 17, 2022

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
Copy link

mrwwalmsley commented Oct 12, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants