Skip to content

Commit 88525d6

Browse files
committed
Improve scopes capture replace snippets
1 parent c2c6747 commit 88525d6

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"typescript.format.semicolons": "insert",
1212
"files.trimFinalNewlines": true,
1313
"C_Cpp.errorSquiggles": "enabled",
14-
"[typescript][json][jsonc]": {
14+
"[typescript][json][jsonc][snippets]": {
1515
"files.insertFinalNewline": true, // because of Github
1616
},
1717
}
Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,48 @@
11
{
2-
"${}": {
2+
"UPdowncase Replace": {
33
"prefix": [
44
"${}",
55
],
6-
"body": "${${1:${TM_SELECTED_TEXT:0}}:/${2|upcase,downcase|}}$0",
6+
"body": "${${1|0,1,2,3|}:/${2|upcase,downcase|}}",
77
"description": [
88
"Capture replace case format.",
99
"Converts all the captured alphabetic characters to UPPERCASE or lowercase.",
1010
"All leading dots (.) are stripped.",
1111
""
1212
]
1313
},
14-
"${UPCASE}": {
14+
"UPCASE REPLACE": {
1515
"prefix": [
1616
"upcase",
1717
],
18-
"body": "${${1:${TM_SELECTED_TEXT:1}}:/upcase}$0",
18+
"body": "${${1|0,1,2,3|}:/${TM_SELECTED_TEXT:upcase}}",
1919
"description": [
2020
"Capture replace case format.",
2121
"Converts all the captured alphabetic characters to UPPERCASE.",
2222
"All leading dots (.) are stripped.",
2323
""
2424
]
2525
},
26-
"${downcase}": {
26+
"downcase replace": {
2727
"prefix": [
28-
"downcase"
28+
"downcase",
2929
],
30-
"body": "${${1:${TM_SELECTED_TEXT:2}}:/downcase}$0",
30+
"body": "${${1|0,1,2,3|}:/${TM_SELECTED_TEXT:downcase}}",
3131
"description": [
3232
"Capture replace case format.",
3333
"Converts all the captured alphabetic characters to lowercase.",
3434
"All leading dots (.) are stripped.",
3535
""
3636
]
3737
},
38+
"Capture Replace": {
39+
"prefix": "$",
40+
"body": "$${1|0,1,2,3|}",
41+
"description": [
42+
"Capture replace format.",
43+
"Replaced with the corresponding capture's captured text.",
44+
"All leading dots (.) are stripped.",
45+
""
46+
]
47+
},
3848
}

0 commit comments

Comments
 (0)