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

Code formatting not working properly #2724

Closed
itfranck opened this issue May 26, 2020 · 2 comments
Closed

Code formatting not working properly #2724

itfranck opened this issue May 26, 2020 · 2 comments
Labels
Resolution-Duplicate Will close automatically.

Comments

@itfranck
Copy link

Issue Type: Bug

Create a new powershell file.

Add the following statement


$CustomerInfos = @{
       CustomerName = 'Customer'  
    CustomerID   = 'abcd'
}

$CustomerInfos = @{
       CustomerName            = 'Customer'  
    CustomerID   = 'abcd'
}

Format the document or save the document (if settings are set to format on save)
CustomerName should be indented properly after the format document command is issued.
It does not happens.

That being said, the equals signs get aligned and extra spaces are removed, as expected.

The issue only happens with Powershell Preview.
If only Powershell is enabled (or both extensions) then the formatting occurs properly, which seems to indicate that both Powershell extension (stable) and PSScriptAnalyzer are not a fault.

This happens in both VSCode and VSCode Insiders.
I also formatted my computer (for unrelated reasons) and experience the same issues .

Relevant formatting settings for reference.

 "powershell.codeFormatting.ignoreOneLineBlock": true,
    "powershell.codeFormatting.openBraceOnSameLine": true,
    "powershell.codeFormatting.newLineAfterCloseBrace": true,
    "powershell.codeFormatting.newLineAfterOpenBrace": true,
    "editor.formatOnType": false,
    "editor.formatOnPaste": true,
    "editor.formatOnSave": true,

Extension version: 2020.5.0
VS Code version: Code 1.45.1 (5763d909d5f12fe19f215cbfdd29a91c0fa9208a, 2020-05-14T08:27:35.169Z)
OS version: Windows_NT x64 10.0.18363

System Info
Item Value
CPUs Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz (8 x 3570)
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: unavailable_off
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) 31.89GB (22.82GB free)
Process Argv
Screen Reader no
VM 0%
@ghost ghost added the Needs: Triage Maintainer attention needed! label May 26, 2020
@ili101
Copy link

ili101 commented May 26, 2020

It's Probably this PowerShell/PSScriptAnalyzer#1508 (Use the workaround setting from there)

@SydneyhSmith is there a way to leave some trace of the tickets moved to other repos here?
Because what happen to me (and probably @itfranck) is that we search here, don't find it and open a duplicate. Maybe instead of moving the issue, duplicate to the other repository and close the original with a link to the one in the other repo (Don't know if it's possible just throwing it out there, there is probably a better solution)

@itfranck
Copy link
Author

Indeed, the issue is the PipelineIndentationStyle.
The link provided solved my issue.

There's at least an issue already (closed) regarding this problem in this repository already:
#2696

#2696 (comment)

@TylerLeonhardt TylerLeonhardt added Resolution-Duplicate Will close automatically. and removed Needs: Triage Maintainer attention needed! labels May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

3 participants