Skip to content

Commit 698ae26

Browse files
committed
feat: add Astro snippets
1 parent a3ce3d8 commit 698ae26

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "static-snippets",
3+
"engines": {
4+
"vscode": "^1.11.0"
5+
},
6+
"contributes": {
7+
"snippets": [
8+
{
9+
"language": "astro",
10+
"path": "./snippets/astro.json"
11+
}
12+
]
13+
}
14+
}

snippets/astro.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
{
2+
"Component": {
3+
"prefix": "comp",
4+
"body": [
5+
"---",
6+
"$1",
7+
"---",
8+
"$0"
9+
],
10+
"description": "Astro component"
11+
},
12+
"Import": {
13+
"prefix": "imp",
14+
"body": ["import $1 from '$0'"],
15+
"description": "Import statement"
16+
},
17+
"Slot": {
18+
"prefix": "slot",
19+
"body": ["<slot />"],
20+
"description": "Slot"
21+
},
22+
"Named Slot": {
23+
"prefix": "nslot",
24+
"body": ["<slot name=\"$1\" />$0"],
25+
"description": "Slot"
26+
},
27+
"Slot with Fallback": {
28+
"prefix": "fslot",
29+
"body": [
30+
"<slot>",
31+
"\t$0",
32+
"</slot>"
33+
],
34+
"description": "Slot with Fallback"
35+
},
36+
"Astro Glob": {
37+
"prefix": "glob",
38+
"body": ["await Astro.glob('$1')$0"],
39+
"description": "Astro glob"
40+
},
41+
"Astro Props": {
42+
"prefix": "props",
43+
"body": ["const { $1 } = Astro.props$0"],
44+
"description": "Astro props"
45+
},
46+
"Astro Params": {
47+
"prefix": "aparams",
48+
"body": ["const { $1 } = Astro.params$0"],
49+
"description": "Astro params"
50+
},
51+
"Astro Request": {
52+
"prefix": "areq",
53+
"body": ["Astro.request."],
54+
"description": "Astro request"
55+
},
56+
"Astro Response": {
57+
"prefix": "aresp",
58+
"body": ["Astro.response."],
59+
"description": "Astro response"
60+
},
61+
"Astro Redirect": {
62+
"prefix": "ared",
63+
"body": ["Astro.redirect('$1')$0"],
64+
"description": "Astro redirect"
65+
},
66+
"Astro Client Address": {
67+
"prefix": "aca",
68+
"body": ["Astro.clientAddress"],
69+
"description": "Astro client address"
70+
},
71+
"Astro Generator": {
72+
"prefix": "agen",
73+
"body": ["Astro.generator"],
74+
"description": "Astro generator"
75+
}
76+
}

0 commit comments

Comments
 (0)