question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong indent for pipelines

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

PowerShell allows line breaks in pipelines without a backtick. I would expect the editor to indent it as if the backtick was present.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.2.7
PSEdition                      Core
GitCommitId                    7.2.7
OS                             Microsoft Windows 10.0.22621
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.73.0
8fa188b2b301d36553cbc9ce1b0a146ccb93351f

Extension Version

ms-vscode.powershell@2022.10.0

Steps to Reproduce

Expected:

Get-ChildItem |
  Select-Object Name

Get-ChildItem | `
  Select-Object Name

Actual:

Get-ChildItem |
Select-Object Name

Get-ChildItem | `
  Select-Object Name

Visuals

No response

Logs

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:1
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
aelijcommented, Nov 27, 2022

@RansomVO I suggest you open a separate issue for this

0reactions
andschwacommented, Dec 7, 2022

@aelij I agree, and so I opened an RFC here, please do share your comment: https://github.com/PowerShell/vscode-powershell/issues/4296

Read more comments on GitHub >

github_iconTop Results From Across the Web

YAML error in azure-pipelines.yml: "Bad indentation of a ...
In my case, I'm passing a string value to the “appSettings:” property but the value is at the same indentation level as the...
Read more >
Formatter fails for multi-line pipelines when the first ... - GitHub
Under extension settings, set Pipeline Indentation Style to IncreaseIndentationForFirstPipeline (which I think is a more sensible default ...
Read more >
Bad indentation of a sequence entry bitbucket pipelines
The issue is you have a colon followed by a space, which causes the YAML parser to interpret this as a map and...
Read more >
How do I indent a pipe in a step? - Atlassian Community
Solved: getting error 'Expected either a string or a pipe' in validator using: pipelines: default: - step: name: Build and push to S3 ......
Read more >
Indentation technique provides pipeline integrity monitoring
This article describes applications of a stress-strain microprobe (SSM) system using an in situ nondestructive ABI test technique to measure ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found