@@ -133,7 +133,6 @@ public override IEnumerable<DiagnosticRecord> AnalyzeScript(Ast ast, string file
133
133
var currentIndenationLevelIncreaseDueToPipelines = 0 ;
134
134
var onNewLine = true ;
135
135
var pipelineAsts = ast . FindAll ( testAst => testAst is PipelineAst && ( testAst as PipelineAst ) . PipelineElements . Count > 1 , true ) . ToList ( ) ;
136
- int minimumPipelineAstIndex = 0 ;
137
136
/*
138
137
When an LParen and LBrace are on the same line, it can lead to too much de-indentation.
139
138
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
273
272
if ( pipelineIndentationStyle == PipelineIndentationStyle . None ) { continue ; }
274
273
275
274
// 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 ) ;
277
276
if ( matchingPipeLineAstEnd == null )
278
277
{
279
278
continue ;
@@ -412,10 +411,10 @@ private static CommandBaseAst LastPipeOnFirstLineWithPipeUsage(PipelineAst pipel
412
411
return lastPipeOnFirstLineWithPipeUsage ;
413
412
}
414
413
415
- private static PipelineAst MatchingPipelineAstEnd ( List < Ast > pipelineAsts , ref int minimumPipelineAstIndex , Token token )
414
+ private static PipelineAst MatchingPipelineAstEnd ( List < Ast > pipelineAsts , Token token )
416
415
{
417
416
PipelineAst matchingPipeLineAstEnd = null ;
418
- for ( int i = minimumPipelineAstIndex ; i < pipelineAsts . Count ; i ++ )
417
+ for ( int i = 0 ; i < pipelineAsts . Count ; i ++ )
419
418
{
420
419
if ( pipelineAsts [ i ] . Extent . EndScriptPosition . LineNumber > token . Extent . EndScriptPosition . LineNumber )
421
420
{
@@ -425,7 +424,6 @@ private static PipelineAst MatchingPipelineAstEnd(List<Ast> pipelineAsts, ref in
425
424
if ( PositionIsEqual ( pipelineAsts [ i ] . Extent . EndScriptPosition , token . Extent . EndScriptPosition ) )
426
425
{
427
426
matchingPipeLineAstEnd = pipelineAsts [ i ] as PipelineAst ;
428
- minimumPipelineAstIndex = i ;
429
427
break ;
430
428
}
431
429
}
0 commit comments