cheptsov / AdvancedExpressionFolding

https://plugins.jetbrains.com/plugin/9320?pr=idea
141 stars 30 forks source link

Incorrect folding of for loop #149

Open cbruegg opened 3 years ago

cbruegg commented 3 years ago

I'm experiencing issues possibly related to curly braces being on a new line instead of in the same line. For example:

for (int i = 0; i < colorSequence.length; i++)
{
    Color color = colorSequence[i];
    bean.setRGBColor(i, color.getRed(), color.getGreen(), color.getBlue(), token);
}

is folded to

for val (i = 0; i < colorSequence.length; i++)
{
    Color color : colorSequence) {
    bean.setRGBColor(i, color.getRed(), color.getGreen(), color.getBlue(), token);
}