Indentation breaks using anything other than pipelineIndentationStyle: None using a second pipe within parenthesis
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 42/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- powershell, vscode
- Domínio
- tooling
Direção de pesquisa
Comece reproduzindo o comportamento de formatação no PowerShell formatter com o pipeline de várias linhas e a expressão entre parênteses da issue. Rastreie como a formatação trata o segundo pipe e o parêntese de fechamento; estará concluído quando o Write-Host seguinte permanecer no nível correto de indentação do nível superior após a formatação.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
The formatting of code breaks, not closing the indentation where it is logical. The conditions are highlighted in the Steps to reproduce section but it seems to be related to using both the pipe | and parenthesis () in multiple lines.
PowerShell Version
Name Value
---- -----
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Microsoft Windows 10.0.19045
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.86.2
x64
Extension Version
ms-vscode.powershell@2024.3.0
Steps to Reproduce
- Open a new file and paste this code:
1 | Select-Object (
$_ |
Write-Host
)
Write-Host 'Indentation is broken'
- Format the document
Write-Hostis now indented at the same level as the closed parenthesis:
1 | Select-Object (
$_ |
Write-Host
)
Write-Host 'Indentation is broken'
Visuals
No response
Logs
No response
- Linguagem predominante
- C#
- Estrelas
- 2.2k
- Forks
- 415
- Merge médio
- 13h 1min
- PRs com merge (30d)
- 2
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de PowerShell/PSScriptAnalyzer
-
Up-for-Grabs
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
PowerShell/PSScriptAnalyzer#2213 · 2 comentários ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 72/100
PowerShell/PSScriptAnalyzer#2217 · 1 comentário ·
-
PSUseConsistentIndentation double-indents attribute bodies that open a scriptblock (`[Attr({ … })]`) Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 70/100
PowerShell/PSScriptAnalyzer#2216 · 2 comentários ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
PowerShell/PSScriptAnalyzer#2211 ·
-
`PSPlaceOpenBrace` and `PSPlaceCloseBrace` leave trailing whitespace when expanding one-line blocks Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 70/100
PowerShell/PSScriptAnalyzer#2210 ·
Todas as issues de PowerShell/PSScriptAnalyzer
Issues semelhantes
-
bug frontend good first issue
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
NavigationViewItemAutomationPeer implements IInvokeProvider but never advertises the Invoke pattern Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
unoplatform/uno#24629 ·
-
agentic-workflows Needs: Triage :mag: State: In-PR
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
CS0162 "Unreachable code detected" warning from a MSBuildTemp .tmp file in every game project Abertabug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
-
Type: enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
apache/arrow-adbc#4809 ·