Skip to content

Commit 98ca402

Browse files
authored
[feat] Add snippets (#1373)
#1372
1 parent 619d9cd commit 98ca402

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

packages/svelte-vscode/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,12 @@
562562
{
563563
"language": "svelte"
564564
}
565+
],
566+
"snippets": [
567+
{
568+
"language": "svelte",
569+
"path": "./snippets/svelte.json"
570+
}
565571
]
566572
},
567573
"devDependencies": {
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"if": {
3+
"body": [
4+
"{#if ${1:condition}}",
5+
"\t$TM_SELECTED_TEXT$0",
6+
"{/if}"
7+
],
8+
"description": "if block"
9+
},
10+
"await": {
11+
"body": [
12+
"{#await ${1:promise}}",
13+
"\t$TM_SELECTED_TEXT$0",
14+
"{/await}"
15+
],
16+
"description": "await block"
17+
},
18+
"await then shorthand": {
19+
"body": [
20+
"{#await ${1:promise} then $2}",
21+
"\t$TM_SELECTED_TEXT$0",
22+
"{/await}"
23+
],
24+
"description": "await block without pending state"
25+
},
26+
"each": {
27+
"body": [
28+
"{#each ${1:array} as ${2:item}}",
29+
"\t$TM_SELECTED_TEXT$0",
30+
"{/each}"
31+
],
32+
"description": "each block"
33+
},
34+
"key": {
35+
"body": [
36+
"{#key ${1:key}}",
37+
"\t$TM_SELECTED_TEXT$0",
38+
"{/key}"
39+
],
40+
"description": "key block"
41+
}
42+
}

0 commit comments

Comments
 (0)