You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The changes to snippets in the latest release of VS Code (1.8.0) have broken PowerShell snippets - the $ prefix on PowerShell variables is being stripped, unless the name of the PowerShell variable is a snippet variable.
# Parameter help description
[Parameter(AttributeValues)]
[ParameterType]
$ParameterName
Ex. 2 - broken
"Parameter-Path": {
"prefix": "parameter-path",
"body": [
"# Specifies a path to one or more locations.",
"[Parameter(Mandatory=$true,",
" Position=${Position:0},",
" ParameterSetName=\"${ParameterSetName:Path}\",",
" ValueFromPipeline=$true,",
" ValueFromPipelineByPropertyName=$true,",
" HelpMessage=\"Path to one or more locations.\")]",
"[Alias(\"PSPath\")]",
"[ValidateNotNullOrEmpty()]",
"[string[]]",
"$${ParameterName:Path}$0"
],
"description": "Parameter declaration snippet for Path parameter that does not accept wildcards. Do not use with parameter-literalpath."
},
# Specifies a path to one or more locations.
[Parameter(Mandatory=true,Position=0,ParameterSetName="Path",ValueFromPipeline=true,ValueFromPipelineByPropertyName=true,HelpMessage="Path to one or more locations.")]
[Alias("PSPath")]
[ValidateNotNullOrEmpty()]
[string[]]
$Path
In this case the $Path variable is okay, but $true is rendered as true in the inserted snippet.
The text was updated successfully, but these errors were encountered:
System Details
VSCode Version 1.8.0
PowerShell extension version: 0.7.2
Output from
$PSVersionTable
:Issue Description
The changes to snippets in the latest release of VS Code (1.8.0) have broken PowerShell snippets - the $ prefix on PowerShell variables is being stripped, unless the name of the PowerShell variable is a snippet variable.
Ex. 1 - works
Ex. 2 - broken
In this case the $Path variable is okay, but $true is rendered as true in the inserted snippet.
The text was updated successfully, but these errors were encountered: