-
Notifications
You must be signed in to change notification settings - Fork 391
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
BUG: Formatting replaces double colon :: with a single one : #1619
Comments
Does the code in #1541 break with this setting on? |
Looks to be a duplicate of #1561 |
@rdhar it would also be helpful if you could provide the information requested in the issue template:
|
This issue has been marked as duplicate and has not had any activity for 1 day. It will be closed for housekeeping purposes. |
Apologies for the delay; here's the update as requested. Environment Data> $PSVersionTable
Name Value
---- -----
PSVersion 7.1.0
PSEdition Core
GitCommitId 7.1.0
OS Microsoft Windows 10.0.19042
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
> (Get-Module -ListAvailable PSScriptAnalyzer).Version | ForEach-Object { $_.ToString() }
1.19.1 That's right, @ninmonkey, the code only breaks with I've added another example scenario which demonstrates the issue; replacing Note, it only impacts PowerShell v2020.6.0 extension, as opposed to PowerShell Preview v2020.9.0. Given the issue cannot be replicated in the latest Preview, I'm not fussed about a resolution in the stable version. # Input
Invoke-WebRequest … -Body "eai:data=$([uri]::EscapeDataString($source.InnerXml))"
Write-Host "eai:data=$([uri]::EscapeDataString('123++'))"
# Actual behaviour
Invoke-WebRequest … -Body "eai:data=$([uri]:EscapeDataString($source.InnerXml))"
Write-Host "eai:data=$([uri]:EscapeDataString('123++'))" |
This is a bug that got fixed in pssa 1.19.1, hence why it does not occur in the stable extension, which has not had been updated for a looong time... |
Steps to reproduce
Input the following snippet and observe as the formatting replaces the double colon
::
with a single one:
.Expected behavior
There should be no change.
Actual behavior
After formatting, the double colon
::
is replaced with a single one:
, thereby breaking the code.Environment data
Toggling each one, it appears to be down to
"powershell.codeFormatting.whitespaceBetweenParameters": true,
rule which causes the issue with VS Code's PowerShell 2020.6.0 extension.Doesn't seem to be replicable in VS Code's PowerShell Preview 2020.9.0, even with the aforementioned rule enabled.
Thanks for your time.
The text was updated successfully, but these errors were encountered: