Hey Sarah. Thanks for sharing your snippets by making it an extension and marking Vetur as a dependency.
In the demo, some stuff were not working correctly, so I'm here to ask for your setup and make the right PR to improve the snippets.
- Vetur offers some
scaffold
snippets, so vbase
might be unnecessary
- I didn't see the snippets showing up in your gif (they should show up like IntelliSense items). For example, how did you get
vanim
to expand in the <template>
in your gif?
Here is how it should be:
- Vetur divides vue files into "regions" with specific languages, and snippets should be declared according to the regions that they belong to. For example,
<template>
<!-- vue-html region -->
</template>
<!-- vue region -->
<style lang="scss">
.hi { // scss region
color: red; // scss region
} // scss region
</style>
<!-- vue region -->
The idea is, each "region" has a language defined by lang
value, with the exception of <template>
, which has language vue-html
.
Now you are marking everything as js snippets, so they would be available only in <script>
, which is wrong for vanim
etc:
The correct way is to divide template
/ js
snippets into two files, and change the language associations (template
to vue-html
, js
to javascript
) in your contributes.snippets
in package.json
. Top level snippets, such as vbase
should be associated for language vue
.
Let me know how you want to proceed. I can soon send a PR that
- removes
vbase
as it's covered by scaffold snippets
- puts snippets into different files and associates them with correct languages