eclipse.platform.ui icon indicating copy to clipboard operation
eclipse.platform.ui copied to clipboard

[Code Folding] opening of collapsed anonymous class doesn't work

Open Wittmaxi opened this issue 2 years ago • 3 comments

Description I cannot open a collapsed anonymous class after collapsing all. Works fine with methods. The "+"-icon that indicates code folding correctly changes to "-"

grafik grafik grafik

Reproduce In a File with anonymous classes, use "Folding -> Collapse All". Try to uncollapse the anonymous class

Expected behaviour I expect the anonymous class to unfold like any other folded block.

My system Eclipse SDK

Version: 2023-12 (4.30) Build id: I20230913-1800

Wittmaxi avatar Sep 29 '23 12:09 Wittmaxi

grafik

Works fine in this case ?!

Wittmaxi avatar Sep 29 '23 12:09 Wittmaxi

Interesting issue. This is a minimal reproducing Java code snippet:

public class Test {
	Test t = new Test() {
	};
}

After a Collapse All, the anonymous inner class won't expand with the "+" button. You can only expand by pressing space at the end of the line or the like.

Since it only happen for this specific kind of statement, my guess is that this is something specific to JDT UI rather than general editor support from Platform UI.

HeikoKlare avatar Sep 29 '23 15:09 HeikoKlare

I reported a bug in WildWebDeveloper due to an issue with the collapse imports within a JS file. The problem seems very (if not exactly) simmilar to this bug. Wanted to past the link to the bug reported in WildWebDeveloper here just in case it is helpful as well:

https://github.com/eclipse-wildwebdeveloper/wildwebdeveloper/issues/1508

In addition to the folded import section not un-folding consistently (and always re-folding) it causes an issue editing a JS file on a line close to (say within 10 or so lines and up) where the folded imports exist where the files scroll position jumps up/down (when the collapse section is opening and then closing, after a short pause in editing a line). This jumping shows as a kind of flicker on the screen, but does sometimes causes the edited line (where the cursor is) to scroll out of view.

jridge-ezclocker avatar Apr 03 '24 20:04 jridge-ezclocker