@@ -133,7 +133,6 @@ public override IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string file
133133 var currentIndenationLevelIncreaseDueToPipelines = 0 ;
134134 var onNewLine = true ;
135135 var pipelineAsts = ast . FindAll ( testAst => testAst is PipelineAst && ( testAst as PipelineAst ) . PipelineElements . Count > 1 , true ) . ToList ( ) ;
136- int minimumPipelineAstIndex = 0 ;
137136 /*
138137 When an LParen and LBrace are on the same line, it can lead to too much de-indentation.
139138 In order to prevent the RParen code from de-indenting too much, we keep a stack of when we skipped the indentation
@@ -273,7 +272,7 @@ caused by tokens that require a closing RParen (which are LParen, AtParen and Do
273272 if ( pipelineIndentationStyle == PipelineIndentationStyle . None ) { continue ; }
274273
275274 // Check if the current token matches the end of a PipelineAst
276- PipelineAst matchingPipeLineAstEnd = MatchingPipelineAstEnd ( pipelineAsts , ref minimumPipelineAstIndex , token ) ;
275+ PipelineAst matchingPipeLineAstEnd = MatchingPipelineAstEnd ( pipelineAsts , token ) ;
277276 if ( matchingPipeLineAstEnd == null )
278277 {
279278 continue ;
@@ -412,10 +411,10 @@ private static CommandBaseAst LastPipeOnFirstLineWithPipeUsage(PipelineAst pipel
412411 return lastPipeOnFirstLineWithPipeUsage ;
413412 }
414413
415- private static PipelineAst MatchingPipelineAstEnd ( List < Ast > pipelineAsts , ref int minimumPipelineAstIndex , Token token )
414+ private static PipelineAst MatchingPipelineAstEnd ( List < Ast > pipelineAsts , Token token )
416415 {
417416 PipelineAst matchingPipeLineAstEnd = null ;
418- for ( int i = minimumPipelineAstIndex ; i < pipelineAsts . Count ; i ++ )
417+ for ( int i = 0 ; i < pipelineAsts . Count ; i ++ )
419418 {
420419 if ( pipelineAsts [ i ] . Extent . EndScriptPosition . LineNumber > token . Extent . EndScriptPosition . LineNumber )
421420 {
@@ -425,7 +424,6 @@ private static PipelineAst MatchingPipelineAstEnd(List<Ast> pipelineAsts, ref in
425424 if ( PositionIsEqual ( pipelineAsts [ i ] . Extent . EndScriptPosition , token . Extent . EndScriptPosition ) )
426425 {
427426 matchingPipeLineAstEnd = pipelineAsts [ i ] as PipelineAst ;
428- minimumPipelineAstIndex = i ;
429427 break ;
430428 }
431429 }
0 commit comments