Skip to content

Commit d83c21f

Browse files
committed
refactor: Add back parentheses to function snippets.
close #4
1 parent dafac91 commit d83c21f

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

README.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,18 @@ No parentheses can make function snippet more flexible for generator function, g
7575
| `tcf` | try/catch/finally | `try {$1} catch $2 {$3} finally {$0}` |
7676

7777
### Functions
78-
| Prefix | Desc | Body |
79-
| -----: | ---------------------------------------------- | ------------------------ |
80-
| `f` | function | `function $1 {$0}` |
81-
| `fa` | async function | `async function $1 {$0}` |
82-
| `af` | arrow function (ES2015) | `$1 => $0` |
83-
| `afa` | async arrow function (ES2015) | `async $1 => $0` |
84-
| `iife` | immediately-invoked function expression (IIFE) | `($2)($1)$0` |
85-
| `pd` | parameter destructuring with type (TypeScript) | `${0:param} : ${1:type}` |
78+
| Prefix | Desc | Body |
79+
| -----: | ---------------------------------------------- | ------------------------------ |
80+
| `f` | function | `function $1($2) {$0}` |
81+
| `f` | function (TypeScript) | `function $1($2)$3 {$0}` |
82+
| `fa` | async function | `async function $1($2) {$0}` |
83+
| `fa` | async function (TypeScript) | `async function $1($2)$3 {$0}` |
84+
| `af` | arrow function (ES2015) | `($1) => $0` |
85+
| `af` | arrow function (ES2015 - TypeScript) | `$1($2)$3 => $0` |
86+
| `afa` | async arrow function (ES2015) | `async ($1) => $0` |
87+
| `afa` | async arrow function (ES2015 - TypeScript) | `async $1($2)$3 => $0` |
88+
| `iife` | immediately-invoked function expression (IIFE) | `($2)($1)$0` |
89+
| `pd` | parameter destructuring with type (TypeScript) | `${0:param} : ${1:type}` |
8690

8791
### Iterables
8892
| Prefix | Desc | Body |

snippets/javascript.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,22 @@
109109

110110
"function": {
111111
"prefix": "f",
112-
"body": "function $1 {$0}",
112+
"body": "function $1($2) {$0}",
113113
"description": "function"
114114
},
115115
"async function": {
116116
"prefix": "fa",
117-
"body": "async function $1 {$0}",
117+
"body": "async function $1($2) {$0}",
118118
"description": "async function"
119119
},
120120
"arrow function (ES2015)": {
121121
"prefix": "af",
122-
"body": "$1 => $0",
122+
"body": "($1) => $0",
123123
"description": "arrow function (ES2015)"
124124
},
125125
"async arrow function (ES2015)": {
126126
"prefix": "afa",
127-
"body": "async $1 => $0",
127+
"body": "async ($1) => $0",
128128
"description": "async arrow function (ES2015)"
129129
},
130130
"immediately-invoked function expression (IIFE)": {

snippets/typescript.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,22 @@
109109

110110
"function": {
111111
"prefix": "f",
112-
"body": "function $1 {$0}",
112+
"body": "function $1($2)$3 {$0}",
113113
"description": "function"
114114
},
115115
"async function": {
116116
"prefix": "fa",
117-
"body": "async function $1 {$0}",
117+
"body": "async function $1($2)$3 {$0}",
118118
"description": "async function"
119119
},
120120
"arrow function (ES2015)": {
121121
"prefix": "af",
122-
"body": "$1 => $0",
122+
"body": "$1($2)$3 => $0",
123123
"description": "arrow function (ES2015)"
124124
},
125125
"async arrow function (ES2015)": {
126126
"prefix": "afa",
127-
"body": "async $1 => $0",
127+
"body": "async $1($2)$3 => $0",
128128
"description": "async arrow function (ES2015)"
129129
},
130130
"immediately-invoked function expression (IIFE)": {

0 commit comments

Comments
 (0)