From 6c1ecb88cce70b783d7f718606fc2cd950035338 Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Thu, 14 Jun 2018 14:34:58 +0200 Subject: [PATCH 1/3] Add new snippet for #region --- docs/community_snippets.md | 19 +++++++++++++++++++ snippets/PowerShell.json | 9 +++++++++ 2 files changed, 28 insertions(+) diff --git a/docs/community_snippets.md b/docs/community_snippets.md index 3c684969a5..6b89ae980b 100644 --- a/docs/community_snippets.md +++ b/docs/community_snippets.md @@ -28,6 +28,7 @@ _To contribute, check out our [guide here](#contributing)._ | [PesterTestForMandatoryParameter](#pestertestformandatoryparameter) | _Create Pester test for a mandatory parameter_ | | [PesterTestForParameter](#pestertestforparameter) | _Create Pester test for parameter_ | | [PSCustomObject](#pscustomobject) | _A simple PSCustomObject by @brettmillerb_ | +| [Region Block](#region-block) | _Region Block for organizing and folding of your code_ | ## Snippets @@ -292,6 +293,24 @@ A simple PSCustomObject by @brettmillerb. It has 4 properties that you can tab t } ``` +### Region Block + +Use the `#region` for organizing your code (including good code folding). + +#### Snippet + +```json +"Region Block": { + "prefix": "#region", + "body": [ + "#region ${1}", + "${2}", + "#endregion ${1}" + ], + "description": "Region Block for organizing and folding of your code" +} +``` + ## Contributing If you'd like to add a snippet to this list, [open a pull request](https://opensource.guide/how-to-contribute/#opening-a-pull-request) with the following changes: diff --git a/snippets/PowerShell.json b/snippets/PowerShell.json index e02f9f76c2..76ef2694b2 100644 --- a/snippets/PowerShell.json +++ b/snippets/PowerShell.json @@ -943,5 +943,14 @@ "}" ], "description": "Creates a Hashtable" + }, + "Region Block": { + "prefix": "#region", + "body": [ + "#region ${1}", + "${2}", + "#endregion ${1}" + ], + "description": "Region Block for organizing and folding of your code" } } From ecdac96f10595be0f59fbe53ee151b5d14bb4bf8 Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Fri, 15 Jun 2018 08:27:23 +0200 Subject: [PATCH 2/3] Removed name of region on end --- docs/community_snippets.md | 5 ++++- snippets/PowerShell.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/community_snippets.md b/docs/community_snippets.md index 6b89ae980b..dd50655354 100644 --- a/docs/community_snippets.md +++ b/docs/community_snippets.md @@ -1,3 +1,5 @@ + + # Awesome VSCode Snippets for PowerShell > A curated list of awesome vscode snippets for PowerShell. @@ -272,6 +274,7 @@ Quickly create a Pester Test for existence of a parameter by @SQLDBAWithABeard "description": "Pester Test for Parameter" } ``` + ### PSCustomObject A simple PSCustomObject by @brettmillerb. It has 4 properties that you can tab through to quickly fill in. @@ -305,7 +308,7 @@ Use the `#region` for organizing your code (including good code folding). "body": [ "#region ${1}", "${2}", - "#endregion ${1}" + "#endregion" ], "description": "Region Block for organizing and folding of your code" } diff --git a/snippets/PowerShell.json b/snippets/PowerShell.json index 76ef2694b2..753ae61430 100644 --- a/snippets/PowerShell.json +++ b/snippets/PowerShell.json @@ -949,7 +949,7 @@ "body": [ "#region ${1}", "${2}", - "#endregion ${1}" + "#endregion" ], "description": "Region Block for organizing and folding of your code" } From 28d481f63fed0bec9fab3e5ec54fc6f7448d5eff Mon Sep 17 00:00:00 2001 From: Oliver Lipkau Date: Fri, 15 Jun 2018 19:52:34 +0200 Subject: [PATCH 3/3] Moved Markdown rule to other PR --- docs/community_snippets.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/community_snippets.md b/docs/community_snippets.md index dd50655354..053c863ff2 100644 --- a/docs/community_snippets.md +++ b/docs/community_snippets.md @@ -1,5 +1,3 @@ - - # Awesome VSCode Snippets for PowerShell > A curated list of awesome vscode snippets for PowerShell.