Skip to content

Commit

Permalink
Merge pull request #10 from deinsoftware/dev
Browse files Browse the repository at this point in the history
restore some explicit empty snippets
  • Loading branch information
equiman authored Oct 25, 2022
2 parents 862a693 + 7e587a0 commit 812613f
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"aafe",
"aafea",
"aafead",
"aafee",
"aafeea",
"aafii",
"afad",
"afeea",
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,18 @@ Fixed for any bug fixes.
Security to invite users to upgrade in case of vulnerabilities.
-->

## 3.1.0 - 2022/10/25

### Added

- Restored `afee` and `afeea` snippets by community request, to easy use on unit testing.
- Added the `aafee` and `aafeea` with async snippets.

## 3.0.0 - 2022/10/18

### Removed

- Snippets `afee` and `afeea` on arrow functions without return. Were replaced adding an extra step (with tab) on the other snippets that include return to easy delete if was need.
- Snippets `afee` and `afeea` on arrow functions without return. Were replaced adding an extra step (with tab) on the other snippets that include return to easy delete if was not need.

### Added

Expand Down
26 changes: 15 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,24 +111,28 @@ Below is a list of all available snippets and the triggers of each one. The **
| `afe→` | explicit return | <code>() => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
| `afea→` | explicit return with arg(s) | <code>(arg) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
| `afead→` | explicit return with arg destructuring | <code>({prop, prop}) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
| `afee→` | explicit empty | <code>() => {<br/>&nbsp;&nbsp;█<br/> }</code> |
| `afeea→` | explicit empty with arg(s) | <code>(arg) => {<br/>&nbsp;&nbsp;█<br/> }</code> |
| `afp→` | explicit with parentheses | <code>() => {<br/>&nbsp;&nbsp;(█)<br/> }</code> |
| `afpa→` | explicit with parentheses and arg(s) | <code>(arg) => {<br/>&nbsp;&nbsp;(█)<br/> }</code> |
| `afii→` | immediately invoque | `(() => █)()` |
| `iiaf→` | immediately invoque | `(() => █)()` |

#### Async Arrow Functions

| Trigger | Description | Result JS/TS |
| -------: | -------------------------------------- | ---------------------------------------------------------------- |
| `aaf→` | implicit return without arg(s) | `async () => █` |
| `aafa→` | implicit return with arg(s) | `async (arg) => █` |
| `aafad→` | implicit with arg destructuring | `async ({ prop }) => █` |
| `aafe→` | explicit return | <code>async () => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
| `aafea→` | explicit return with arg(s) | <code>async (arg) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
|`aafead→` | explicit return with arg destructuring | <code>async ({prop, prop}) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
|`aaafea→` | explicit with args and await | <code>async (arg) => {<br/>&nbsp;&nbsp;const name = await █<br/> }</code>|
| `aafii→` | immediately invoked | `(async () => █)()` |
| `iiaaf→` | immediately invoked | `(async () => █)()` |
| Trigger | Description | Result JS/TS |
| -------: | -------------------------------------- | ------------------------------------------------------------------------- |
| `aaf→` | implicit return without arg(s) | `async () => █` |
| `aafa→` | implicit return with arg(s) | `async (arg) => █` |
| `aafad→` | implicit with arg destructuring | `async ({ prop }) => █` |
| `aafe→` | explicit return | <code>async () => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
| `aafea→` | explicit return with arg(s) | <code>async (arg) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
|`aafead→` | explicit return with arg destructuring | <code>async ({prop, prop}) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
| `aafee→` | explicit empty | <code>async () => {<br/>&nbsp;&nbsp;█<br/> }</code> |
|`aafeea→` | explicit empty with arg(s) | <code>async (arg) => {<br/>&nbsp;&nbsp;█<br/> }</code> |
|`aaafea→` | explicit with args and await | <code>async (arg) => {<br/>&nbsp;&nbsp;const name = await █<br/> }</code> |
| `aafii→` | immediately invoked | `(async () => █)()` |
| `iiaaf→` | immediately invoked | `(async () => █)()` |

### Promises

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "arrow-function-snippets",
"description": "VS Code Arrow function snippets for JS and TS",
"version": "3.0.0",
"version": "3.1.0",
"displayName": "Arrow Function Snippets",
"publisher": "deinsoftware",
"icon": "images/light-icon.png",
Expand Down
20 changes: 20 additions & 0 deletions snippets/arrow.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@
"body": ["({${1:prop}, ${2:prop}}) => {", "\t${3:return} $0", "}"],
"description": "Arrow function (explicit return) with argument destructuring"
},
"arrowFunctionExplicitEmpty": {
"prefix": "afee",
"body": ["() => {", "\t$0", "}"],
"description": "Arrow function (without return)"
},
"arrowFunctionExplicitEmptyWithArguments": {
"prefix": "afeea",
"body": ["(${1:arg}) => {", "\t$0", "}"],
"description": "Arrow function (without return) with arguments"
},
"arrowFunctionParentheses": {
"prefix": "afp",
"body": ["() => {", "\t( ${0} )", "}"],
Expand Down Expand Up @@ -84,6 +94,16 @@
"body": ["async ({ ${1:prop}, ${2:prop} }) => {", "\t${3:return} $0", "}"],
"description": "Arrow async function (explicit return) with argument destructuring"
},
"arrowAsyncFunctionExplicitEmpty": {
"prefix": "aafee",
"body": ["async () => {", "\t$0", "}"],
"description": "Arrow async function (without return)"
},
"arrowAsyncFunctionExplicitEmptyWithArguments": {
"prefix": "aafeea",
"body": ["async (${1:arg}) => {", "\t$0", "}"],
"description": "Arrow async function (without return) with arguments"
},
"arrowAsyncAwaitFunctionExplicitWithArguments": {
"prefix": "aaafea",
"body": ["async (${1:arg}) => {", "\tconst ${2:name} = await ${0}", "}"],
Expand Down

0 comments on commit 812613f

Please sign in to comment.