AdvancedExpressionFolding icon indicating copy to clipboard operation
AdvancedExpressionFolding copied to clipboard

Specific folds will "fold" too much text that should not be folded

Open ciscorucinski opened this issue 8 years ago • 3 comments

Some folds are folded perfectly such as the for-loop with ranges...

good_fold

... Notice that the i, start, and end identifiers are still white. They are not folded yellow (due to my color scheme). This is a great fold. However...

1_math_abs Picture A

... the Math.abs(...) folding appears to be a bad fold. A lot of the identifiers inside the function should not be folded yellow, but it should be the color of what those identifiers should normally be. The hex value should be blue in my case and I should have the parameter hint shown, etc.

Here is what my non-folded code looks like...

3_math_abs Picture B


Note: sometimes I can get IntelliJ to unfold to the correct amount; however, it will always be folded to Picture A first. Usually, I when I click on the fold, and it will unfold from Picture A to Picture B. However, sometimes it will unfold from Picture A to Picture C So, it seems like this fold might be doing 1 extra step too much???

2_math_abs Picture C

ciscorucinski avatar Jul 20 '17 09:07 ciscorucinski

The Cast fold also has the same issue, but that one is much harder to solve. It kind of makes my Android Activity classes' OnCreate(...) method overly folded. I wonder if there is a way of showing a more minimal folding impact on the code???

1_cast 2_cast

Just to throw out some ideas, instead of the folded text being val fab = findViewById(R.id.fab) it could be...

1_findviewbyid

ciscorucinski avatar Jul 20 '17 11:07 ciscorucinski

Thanks for examples! I will take a close look.

cheptsov avatar Jul 21 '17 15:07 cheptsov

It looks #103 is about the same problem. Feel free to close it.

sabi0 avatar Jan 19 '18 14:01 sabi0