Skip to content
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

codeFormatting.whitespaceBetweenParameter setting causing characters to be dropped from scripts #1529

Closed
sbrp opened this issue Jun 12, 2020 · 1 comment

Comments

@sbrp
Copy link

sbrp commented Jun 12, 2020

Issue Type: Bug

If "powershell.codeFormatting.whitespaceBetweenParameter" is set to "true", running the auto formatter will result in loss of some characters from scripts.

E.g.
Write-Host "##vso[task.setvariable variable=$VariableName;]$VariableValue"

Becomes
Write-Host "##vso[task.setvariable variable=$VariableName;$VariableValue"
Note the loss of the "]"

If the setting is commented out in settings.json or you set it to "false", the formatter behaves properly.

This also happens with the PowerShell Preview extension.

Extension version: 2020.6.0
VS Code version: Code 1.46.0 (a5d1cc28bb5da32ec67e86cc50f84c67cc690321, 2020-06-10T09:03:20.462Z)
OS version: Windows_NT x64 10.0.18362

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz (8 x 1992)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off_ok
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 7.89GB (1.27GB free)
Process Argv
Screen Reader no
VM 0%
@SydneyhSmith SydneyhSmith transferred this issue from PowerShell/vscode-powershell Jun 16, 2020
@ghost ghost added the Needs: Triage 🔍 label Jun 16, 2020
@bergmeister
Copy link
Collaborator

@sbrp Thank you for taking the time to provide details. This is a new setting that we recently added and its default is false. This issue has already been fixed as part of #1498 but is pending a patch release of PSScriptAnalyzer, which we plan to do in the next few weeks. In the meantime we suggest to set the setting value to its default value of false.
FYI @rjmholt @JamesWTruher @SydneyhSmith

@ghost ghost closed this as completed Jun 24, 2020
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants