gridsome / gridsome-helper-json

Vetur integration information for Gridsome
MIT License
6 stars 1 forks source link

Support page-query and static-query? #6

Open MarcelloTheArcane opened 3 years ago

MarcelloTheArcane commented 3 years ago

Currently, <page-query> and <static-query> tags aren't recognised by Vetur. This means that code folding and syntax highlighting aren't available.

Is this the right place to create something to make that work? Apologies, I'm not entirely sure how the code formatting works on the Vetur plugin, and whether this repository only works for tags within the <template>.

tyankatsu0105 commented 3 years ago

@MarcelloTheArcane Thanks for the issue!

Yes. This helper json supports only inside template.

However, Vetur now supports Snippet. So you can scaffold code like this:

<WORKSPACE>/.vscode/vetur/snippets/page-query/page-query.vue

<page-query>
query {
  posts: ${1} {
    edges {
      node {
        id
        title
      }
    }
  }
}
</page-query>

demo