Title: Incorrect Multi-line Pipeline Indentation when inside a Scriptblock that also has a Pipeline · Issue #1680 · PowerShell/PSScriptAnalyzer · GitHub
Open Graph Title: Incorrect Multi-line Pipeline Indentation when inside a Scriptblock that also has a Pipeline · Issue #1680 · PowerShell/PSScriptAnalyzer
X Title: Incorrect Multi-line Pipeline Indentation when inside a Scriptblock that also has a Pipeline · Issue #1680 · PowerShell/PSScriptAnalyzer
Description: System Details Manjaro Linux: ### VSCode version: 1.56.2 054a9295330880ed74ceaedda236253b4f39a335 x64 ### VSCode extensions: aaron-bond.better-comments@2.1.0 eamodio.gitlens@11.4.1 GitHub.vscode-pull-request-github@0.26.0 ms-dotnettools....
Open Graph Description: System Details Manjaro Linux: ### VSCode version: 1.56.2 054a9295330880ed74ceaedda236253b4f39a335 x64 ### VSCode extensions: aaron-bond.better-comments@2.1.0 eamodio.gitlens@11.4.1 GitHub.vscode-pu...
X Description: System Details Manjaro Linux: ### VSCode version: 1.56.2 054a9295330880ed74ceaedda236253b4f39a335 x64 ### VSCode extensions: aaron-bond.better-comments@2.1.0 eamodio.gitlens@11.4.1 GitHub.vscode-pu...
Opengraph URL: https://github.com/PowerShell/PSScriptAnalyzer/issues/1680
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect Multi-line Pipeline Indentation when inside a Scriptblock that also has a Pipeline","articleBody":"\u003c!--\r\n\r\nBEFORE SUBMITTING A NEW ISSUE, PLEASE READ THE TROUBLESHOOTING DOCS!\r\nhttps://github.com/PowerShell/vscode-powershell/tree/master/docs/troubleshooting.md\r\n\r\nIMPORTANT: you can generate a bug report directly from the\r\nPowerShell extension in Visual Studio Code by selecting\r\n\"PowerShell: Upload Bug Report to GitHub\" from the command palette.\r\n\r\nNOTE: If you have both stable (aka \"PowerShell\") and preview (aka \"PowerShell Preview\") installed,\r\nyou MUST DISABLE one of them for the best performance.\r\nDocs on how to disable an extension can be found here:\r\nhttps://code.visualstudio.com/docs/editor/extension-gallery#_disable-an-extension\r\n\r\nThe more repro details you can provide, along with a zip\r\nof the log files from your session, the better the chances\r\nare for a quick resolution.\r\n\r\nYou may also want to record a GIF of the bug occurring and\r\nattach it here by dropping the file into the description body.\r\n\r\n-->\r\n\r\n### System Details\r\n\r\n\u003c!--\r\nTo help diagnose your issue, the following details are helpful:\r\n- Operating system name and version\r\n- VS Code version\r\n- PowerShell extension version\r\n- Output from `$PSVersionTable`\r\n\r\nTo get this information, run the following expression in your Integrated Console and paste the output here inside the backticks below:\r\n\r\n& {\"### VSCode version: $(code -v)\"; \"`n### VSCode extensions:`n$(code --list-extensions --show-versions | Out-String)\"; \"`n### PSES version: $($pseditor.EditorServicesVersion)\"; \"`n### PowerShell version:`n$($PSVersionTable | Out-String)\"}\r\n\r\n\r\nIf you are running VSCode Insiders, use this expression instead (and paste the result inside the backticks):\r\n\r\n& {\"### VSCode version: $(code-insiders -v)\"; \"`n### VSCode extensions:`n$(code-insiders --list-extensions --show-versions | Out-String)\"; \"`n### PSES version: $($pseditor.EditorServicesVersion)\"; \"`n### PowerShell version:`n$($PSVersionTable | Out-String)\"}\r\n\r\n-->\r\n\r\n\u003c!-- PowerShell output from above goes here -->\r\n**Manjaro Linux:**\r\n``` \r\n### VSCode version: 1.56.2 054a9295330880ed74ceaedda236253b4f39a335 x64\r\n\r\n### VSCode extensions:\r\naaron-bond.better-comments@2.1.0\r\neamodio.gitlens@11.4.1\r\nGitHub.vscode-pull-request-github@0.26.0\r\nms-dotnettools.csharp@1.23.11\r\nms-vscode.mono-debug@0.16.2\r\nms-vscode.powershell@2021.2.2\r\n\r\n\r\n### PSES version: 2.3.0.0\r\n\r\n### PowerShell version:\r\n\r\nName Value\r\n---- -----\r\nPSVersion 7.1.3\r\nPSEdition Core\r\nGitCommitId 7.1.3\r\nOS Linux 5.12.2-1-MANJARO PowerShell/vscode-powershell#1 SMP PREEMPT Fri May 7 17:53:15 UTC 2021\r\nPlatform Unix\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n```\r\n**Windows 10 Enterprise:**\r\n```\r\n### VSCode version: 1.56.2 054a9295330880ed74ceaedda236253b4f39a335 x64\r\n\r\n### VSCode extensions:\r\naaron-bond.better-comments@2.1.0 \r\nCoenraadS.bracket-pair-colorizer-2@0.2.0\r\neamodio.gitlens@11.4.1\r\nGitHub.vscode-pull-request-github@0.26.0\r\nLudwig.wordcounter@0.0.1\r\nms-vscode-remote.remote-wsl@0.56.2 \r\nms-vscode.powershell@2021.2.2\r\nms-vscode.powershell-preview@2021.4.2\r\nshd101wyy.markdown-preview-enhanced@0.5.18\r\ntht13.html-preview-vscode@0.2.5\r\nuctakeoff.vscode-counter@2.2.2\r\n\r\n\r\n### PSES version: 2.4.1.0\r\n\r\n### PowerShell version:\r\n\r\nName Value\r\n---- -----\r\nPSVersion 5.1.19041.906\r\nPSEdition Desktop\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nBuildVersion 10.0.19041.906\r\nCLRVersion 4.0.30319.42000\r\nWSManStackVersion 3.0\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\n```\r\n\r\n### Issue Description\r\n\r\nWhen using `IncreaseIndentationForFirstPipeline` or `IncreaseIndentationAfterEveryPipeline` as multiline pipeline indentation style the code is formatted inproperly when inside a Scriptblock which also has pipeline indents.\r\nExamples are with `IncreaseIndentationForFirstPipeline` and show some Pseudo-Powershell.\r\n\r\n#### Expected Behaviour\r\n```powershell\r\n\r\n# if OTBS and IncreaseIndentationForFirstPipeline is selected this code won't be reformatted as it is already \"correct\"\r\n\r\n$Test = $SomeValues | \r\n Select-Object Some, Values | \r\n Sort-Object -Property Values\r\n\r\nif ($Test) {\r\n #Do stuff with test\r\n}\r\n\r\n# this should also be considered correct and not getting reformated \r\nTest-Scriptblock -Scriptblock {\r\n $Test = $SomeValues | \r\n Select-Object Some, Values | \r\n Sort-Object -Property Values\r\n \r\n if ($Test) {\r\n #Do stuff with test\r\n }\r\n} -PassThru | \r\n Run-Scriptblock\r\n```\r\n\r\n#### Actual Behaviour\r\n\r\n```powershell\r\n\r\n# as expected nothing was reformatted \r\n\r\n$Test = $SomeValues | \r\n Select-Object Some, Values | \r\n Sort-Object -Property Values\r\n\r\nif ($Test) {\r\n #Do stuff with test\r\n}\r\n\r\n# but here the indentiation does not stop at sort-object (..) but rather indents everything that follows too \r\nTest-Scriptblock -Scriptblock {\r\n $Test = $SomeValues | \r\n Select-Object Some, Values | \r\n Sort-Object -Property Values\r\n \r\n if ($Test) {\r\n #Do stuff with test\r\n }\r\n } -PassThru | \r\n Run-Scriptblock\r\n\r\n# with IncreaseIndentationAfterEveryPipeline the same incorrect indentation will be applied \r\nTest-Scriptblock -Scriptblock {\r\n $Test = $SomeValues | \r\n Select-Object Some, Values | \r\n Sort-Object -Property Values\r\n \r\n if ($Test) {\r\n #Do stuff with test\r\n }\r\n } -PassThru | \r\n Run-Scriptblock\r\n```\r\n### Attached Logs\r\n - No logs to attach - ","author":{"url":"https://github.com/ArchitektApx","@type":"Person","name":"ArchitektApx"},"datePublished":"2021-05-16T10:36:36Z","url":"https://github.com/PowerShell/PSScriptAnalyzer/issues/1680"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:19be6a65-b6d4-392c-3121-43a7b5bda2ee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 85B6:C35DD:150CB34:1DA20D6:6AFCE67D |
| html-safe-nonce | 1b00b871677b3712f47b38154659450f5b5331a0b6d441f6972a957029e9db14 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NUI2OkMzNUREOjE1MENCMzQ6MURBMjBENjo2QUZDRTY3RCIsInZpc2l0b3JfaWQiOiI0MTAwNjc0NTk1MjEwNDU0NjUzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ebb413292c037d240b786cee1e684f4f232d6d360261d85d87b4f1e41c858240 |
| hovercard-subject-tag | issue:894760625 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PSScriptAnalyzer/1680/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b0219902e82f43d045e66c0518209b6c49bf1a4922399786a96e08f883002328/PowerShell/PSScriptAnalyzer/issues/1680 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b0219902e82f43d045e66c0518209b6c49bf1a4922399786a96e08f883002328/PowerShell/PSScriptAnalyzer/issues/1680 |
| og:image:alt | System Details Manjaro Linux: ### VSCode version: 1.56.2 054a9295330880ed74ceaedda236253b4f39a335 x64 ### VSCode extensions: aaron-bond.better-comments@2.1.0 eamodio.gitlens@11.4.1 GitHub.vscode-pu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ArchitektApx |
| hostname | github.com |
| expected-hostname | github.com |
| None | 99aede4c5f55ec5cf06666a8c9e03ebf9f85f7231223e7f1c38c16e5504835b3 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PSScriptAnalyzer git https://github.com/PowerShell/PSScriptAnalyzer.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 33149177 |
| octolytics-dimension-repository_nwo | PowerShell/PSScriptAnalyzer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 33149177 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PSScriptAnalyzer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ecfd63ca125ec74b42f74eeb158b3fa081c8c497 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width