-
Notifications
You must be signed in to change notification settings - Fork 510
powershell auto-format indent not tab indenting correctly #1958
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
Comments
Hi @ebmarquez, thanks for opening an issue. This is likely to be a bug in PSScriptAnalyzer, which provides us with formatting functions. Can you please check this by running |
yeah, that's not working. I'm trying to figure out the correct syntax. |
This seems to do what you were intending. $PSUseConsistentIndentation = @{
Enable = 'true'
IndentationSize = 4;
PipelineIndentation = 'IncreaseIndentationForFirstPipeline';
Kind = 'space'
}
$rules = @{
PSUseConsistentIndentation = $PSUseConsistentIndentation;
}
$scriptDefinition = Get-Content -Raw C:\ShowCommand.psm1
Invoke-Formatter -ScriptDefinition $scriptDefinition -Settings @{
IncludeRules = @('PSUserConsistentIndentation')
Rules = $rules
} and it looks like it is indenting incorrectly. |
Ah, yeah, I think the formatting rules require that Ok, that's definitely a PSScriptAnalyzer issue. I've opened a new issue there (linked above). |
Issue Type: Bug
Updating a psm1 function the auto format is incorrectly setting the tabs for the second line past the param().
Settings JSON
Logs
Extension version: 1.12.1
VS Code version: Code 1.33.1 (51b0b28134d51361cf996d2f0a1c698247aeabd8, 2019-04-11T08:27:14.102Z)
OS version: Windows_NT x64 10.0.18362
System Info
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: