From 645be8149ff0f0335cf39c75a266014921cb4f79 Mon Sep 17 00:00:00 2001 From: Ryan Yates Date: Sat, 9 Jun 2018 11:50:10 +0100 Subject: [PATCH 1/5] Edited Snippet to fix issue 1353 Add in Optional Parameters to the Parameter Block --- snippets/PowerShell.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/snippets/PowerShell.json b/snippets/PowerShell.json index 9fb4d01ee1..9d2a3086cd 100644 --- a/snippets/PowerShell.json +++ b/snippets/PowerShell.json @@ -763,7 +763,10 @@ "function": { "prefix": "function", "body": [ - "function ${1:FunctionName} (${2:OptionalParameters}) {", + "function ${1:FunctionName} {", + "\tparam (", + "\t ${2:OptionalParameters}", + "\t)", "\t$0", "}" ], From 25bf7013486594ab7b8a984ba6e84701f30ac1d7 Mon Sep 17 00:00:00 2001 From: Ryan Yates Date: Mon, 11 Jun 2018 14:34:04 +0100 Subject: [PATCH 2/5] update to include a renamed version of the current snippet --- snippets/PowerShell.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/snippets/PowerShell.json b/snippets/PowerShell.json index 9d2a3086cd..bd7144ad47 100644 --- a/snippets/PowerShell.json +++ b/snippets/PowerShell.json @@ -770,7 +770,16 @@ "\t$0", "}" ], - "description": "function definition snippet" + "description": "function definition snippet that contains a param block" + }, + "function-NoParam": { + "prefix": "function-noparam", + "body": [ + "function ${1:FunctionName} (${2:OptionalParameters}) {", + "\t$0", + "}" + ], + "description": "function definition snippet that does not contain a param block and is more typically seen in C#" }, "if": { "prefix": "if", From 34bfecafd898b0ea4cda2b2c180fbd3f10ecaee7 Mon Sep 17 00:00:00 2001 From: Ryan Yates Date: Mon, 11 Jun 2018 19:30:41 +0100 Subject: [PATCH 3/5] update description --- snippets/PowerShell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/PowerShell.json b/snippets/PowerShell.json index bd7144ad47..49be60db29 100644 --- a/snippets/PowerShell.json +++ b/snippets/PowerShell.json @@ -779,7 +779,7 @@ "\t$0", "}" ], - "description": "function definition snippet that does not contain a param block and is more typically seen in C#" + "description": "function definition snippet that does not contain a param block and is commonly used in other lanaguages" }, "if": { "prefix": "if", From ca2c6419a26b1e321b13d1eae74d3c200e2581c3 Mon Sep 17 00:00:00 2001 From: Ryan Yates Date: Mon, 11 Jun 2018 19:31:58 +0100 Subject: [PATCH 4/5] further update to description --- snippets/PowerShell.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/PowerShell.json b/snippets/PowerShell.json index 49be60db29..b5d66206e4 100644 --- a/snippets/PowerShell.json +++ b/snippets/PowerShell.json @@ -779,7 +779,7 @@ "\t$0", "}" ], - "description": "function definition snippet that does not contain a param block and is commonly used in other lanaguages" + "description": "function definition snippet that does not contain a param block, but defines parameters inline. This syntax is commonly used in other lanaguages" }, "if": { "prefix": "if", From 96019e90ae908eb31be2258d9b66c0d4548c3731 Mon Sep 17 00:00:00 2001 From: Ryan Yates Date: Mon, 11 Jun 2018 21:47:57 +0100 Subject: [PATCH 5/5] rename function-NoParam to Function-Inline --- snippets/PowerShell.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snippets/PowerShell.json b/snippets/PowerShell.json index b5d66206e4..e02f9f76c2 100644 --- a/snippets/PowerShell.json +++ b/snippets/PowerShell.json @@ -770,16 +770,16 @@ "\t$0", "}" ], - "description": "function definition snippet that contains a param block" + "description": "Function definition snippet that contains a param block" }, - "function-NoParam": { - "prefix": "function-noparam", + "Function-Inline": { + "prefix": "Function-Inline", "body": [ "function ${1:FunctionName} (${2:OptionalParameters}) {", "\t$0", "}" ], - "description": "function definition snippet that does not contain a param block, but defines parameters inline. This syntax is commonly used in other lanaguages" + "description": "Function definition snippet that does not contain a param block, but defines parameters inline. This syntax is commonly used in other lanaguages" }, "if": { "prefix": "if",