Camelcade / Perl5-IDEA

Perl5 plugins for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/7796-perl/
Other
405 stars 76 forks source link

Add support for values grouping #2578

Open hurricup opened 1 year ago

hurricup commented 1 year ago

Discovered while fixing #2568

if( $a ){
  @arrayA = qw/A1 A2/;
  @arrayB = qw/B1 B2 B3/;
}
else{
  @arrayA = qw/C1 C2 C3/;
  @arrayB = qw/D1 D2/;
}

@array = (@arrayA, @arrayB);

Currently our DFA don't understand that values for arrayA and arrayB are related. And basically it sees them as all possible combinations: A-C A-D B-C and B-D and this is bad for performance and may produce incorrect results.

hurricup commented 1 year ago

Seems that we need to move from up to down, not vice versa. Otherwise it is too complicated.