fresh-snippets
Visual Studio Code snippets for Fresh web framework
Features
Currently has the following snippets:
Prefix |
Description |
api , api-route |
Outputs an API route |
comp , component |
Outputs snippet that can be used for page or island component |
page , page-handler |
Outputs a page component that also has a custom API handler |
Adding snippets
- Create a template for the snippet under
templates directory
- The file name must end with
.template
- Add details of the snippet as a new entry to
templates/details.json using the below format:
{
"name": "Name of the snippet",
"prefix": ["prefixes", "for", "this", "snippet"],
"description": "Description of the snippet"
}
- Run
npm run generate
- This generates a new
snippets/snippets.code-snippets file from the template files and details.json
- Commit the changes
| |