Skip to content

Fix snippet placeholder formatting #795

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 30, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions snippets/PowerShell.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@
"Example-Class": {
"prefix": "ex-class",
"body": [
"class ${classname:MyClass} {",
"class ${1:MyClass} {",
"\t# Property: Holds name",
"\t[String] \\$Name",
"",
"\t# Constructor: Creates a new MyClass object, with the specified name",
"\t${classname:MyClass}([String] \\$NewName) {",
"\t\t# Set name for ${classname:MyClass}",
"\t${1:MyClass}([String] \\$NewName) {",
"\t\t# Set name for ${1:MyClass}",
"\t\t\\$this.Name = \\$NewName",
"\t}",
"",
Expand Down Expand Up @@ -465,7 +465,7 @@
"Class": {
"prefix": "class",
"body": [
"class ${ClassName} {",
"class ${1:ClassName} {",
"\t$0",
"}"
],
Expand All @@ -474,7 +474,7 @@
"Constructor": {
"prefix": "ctor",
"body": [
"${ClassName}(${OptionalParameters}) {",
"${1:ClassName}(${2:OptionalParameters}) {",
"\t$0",
"}"
],
Expand All @@ -483,21 +483,21 @@
"Hidden Property": {
"prefix": "proph",
"body": [
"hidden [${string}] $${PropertyName}"
"hidden [${1:string}] $${0:PropertyName}"
],
"description": "Class hidden property definition snippet"
},
"Property": {
"prefix": "prop",
"body": [
"[${string}] $${PropertyName}"
"[${1:string}] $${0:PropertyName}"
],
"description": "Class property definition snippet"
},
"Method": {
"prefix": "method",
"body": [
"[${void}] ${MethodName}($${OptionalParameters}) {",
"[${1:void}] ${2:MethodName}($${3:OptionalParameters}) {",
"\t$0",
"}"
],
Expand All @@ -506,7 +506,7 @@
"Enum": {
"prefix": "enum",
"body": [
"enum ${EnumName} {",
"enum ${1:EnumName} {",
"\t$0",
"}"
],
Expand All @@ -515,7 +515,7 @@
"Cmdlet": {
"prefix": "cmdlet",
"body": [
"function ${name:Verb-Noun} {",
"function ${1:Verb-Noun} {",
"\t[CmdletBinding()]",
"\tparam (",
"\t\t$0",
Expand Down Expand Up @@ -557,10 +557,10 @@
"Parameter": {
"prefix": "parameter",
"body": [
"# ${Parameter help description}",
"[Parameter(${AttributeValues})]",
"[${ParameterType}]",
"$${ParameterName}"
"# ${1:Parameter help description}",
"[Parameter(${2:AttributeValues})]",
"[${3:ParameterType}]",
"$${0:ParameterName}"
],
"description": "Parameter declaration snippet"
},
Expand All @@ -569,15 +569,15 @@
"body": [
"# Specifies a path to one or more locations.",
"[Parameter(Mandatory=\\$true,",
" Position=${Position:0},",
" ParameterSetName=\"${ParameterSetName:Path}\",",
" Position=${1:0},",
" ParameterSetName=\"${2:ParameterSetName}\",",
" ValueFromPipeline=\\$true,",
" ValueFromPipelineByPropertyName=\\$true,",
" HelpMessage=\"Path to one or more locations.\")]",
"[Alias(\"PSPath\")]",
"[ValidateNotNullOrEmpty()]",
"[string[]]",
"$${ParameterName:Path}$0"
"$${3:ParameterName}$0"
],
"description": "Parameter declaration snippet for Path parameter that does not accept wildcards. Do not use with parameter-literalpath."
},
Expand All @@ -586,15 +586,15 @@
"body": [
"# Specifies a path to one or more locations. Wildcards are permitted.",
"[Parameter(Mandatory=\\$true,",
" Position=${Position:0},",
" ParameterSetName=\"${ParameterSetName:Path}\",",
" Position=${1:Position},",
" ParameterSetName=\"${2:ParameterSetName}\",",
" ValueFromPipeline=\\$true,",
" ValueFromPipelineByPropertyName=\\$true,",
" HelpMessage=\"Path to one or more locations.\")]",
"[ValidateNotNullOrEmpty()]",
"[SupportsWildcards()]",
"[string[]]",
"$${ParameterName:Path}$0"
"$${3:ParameterName}$0"
],
"description": "Parameter declaration snippet for Path parameter that accepts wildcards. Add parameter-literalpath to handle paths with embedded wildcard chars."
},
Expand All @@ -606,14 +606,14 @@
"# enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any",
"# characters as escape sequences.",
"[Parameter(Mandatory=\\$true,",
" Position=${Position:0},",
" ParameterSetName=\"${ParameterSetName:LiteralPath}\",",
" Position=${1:0},",
" ParameterSetName=\"${2:LiteralPath}\",",
" ValueFromPipelineByPropertyName=\\$true,",
" HelpMessage=\"Literal path to one or more locations.\")]",
"[Alias(\"PSPath\")]",
"[ValidateNotNullOrEmpty()]",
"[string[]]",
"$${ParameterName:LiteralPath}$0"
"$${2:LiteralPath}$0"
],
"description": "Parameter declaration snippet for a LiteralPath parameter"
},
Expand Down Expand Up @@ -690,7 +690,7 @@
"body": [
"do {",
"\t$0",
"} until (${condition})"
"} until (${1:condition})"
],
"description": "do-until loop snippet"
},
Expand All @@ -699,14 +699,14 @@
"body": [
"do {",
"\t$0",
"} while (${condition})"
"} while (${1:condition})"
],
"description": "do-while loop snippet"
},
"while": {
"prefix": "while",
"body": [
"while (${condition}) {",
"while (${1:condition}) {",
"\t$0",
"}"
],
Expand All @@ -715,7 +715,7 @@
"for": {
"prefix": "for",
"body": [
"for ($${variable:i} = 0; $${variable:i} -lt $${array}.Count; $${variable:i}++) {",
"for ($${1:i} = 0; $${1:i} -lt $${2:array}.Count; $${1:i}++) {",
"\t$0",
"}"
],
Expand All @@ -724,7 +724,7 @@
"for-reversed": {
"prefix": "forr",
"body": [
"for ($${variable:i} = $${array}.Count - 1; $${variable:i} -ge 0 ; $${variable:i}--) {",
"for ($${1:i} = $${2:array}.Count - 1; $${1:i} -ge 0 ; $${1:i}--) {",
"\t$0",
"}"
],
Expand All @@ -733,7 +733,7 @@
"foreach": {
"prefix": "foreach",
"body": [
"foreach ($${variable:item} in $${collection:collection}) {",
"foreach ($${1:item} in $${2:collection}) {",
"\t$0",
"}"
],
Expand All @@ -742,7 +742,7 @@
"function": {
"prefix": "function",
"body": [
"function ${FunctionName} (${OptionalParameters}) {",
"function ${1:FunctionName} (${2:OptionalParameters}) {",
"\t$0",
"}"
],
Expand All @@ -751,7 +751,7 @@
"if": {
"prefix": "if",
"body": [
"if (${condition}) {",
"if (${1:condition}) {",
"\t$0",
"}"
],
Expand All @@ -760,7 +760,7 @@
"elseif": {
"prefix": "elseif",
"body": [
"elseif (${condition}) {",
"elseif (${1:condition}) {",
"\t$0",
"}"
],
Expand All @@ -778,8 +778,8 @@
"switch": {
"prefix": "switch",
"body": [
"switch (${variable:\\$x}) {",
"\t${condition} { $0 }",
"switch (${1:\\$x}) {",
"\t${2:condition} { $0 }",
"\tDefault {}",
"}"
],
Expand Down