eclipse-jdt / eclipse.jdt.ui

Eclipse Public License 2.0
32 stars 79 forks source link

Outline View subclasses are fully expanded by default whenever a class is selected, whereas before the Outline View was not fully expanded by default #1480

Open jmohrmann opened 2 weeks ago

jmohrmann commented 2 weeks ago

In Eclipse 2024-06, I noticed that, when selecting a Java class, the Outline View loads all the methods, subclasses, etc. for that class, but the subclasses and inner anonymous classes are all fully expanded by default.

In previous versions of Eclipse (2024-03 and prior), only methods that contained anonymous classes were expanded, not all the methods of every subclass. In 2024-06, I usually have to click "Collapse All" and then expand just the top-level type to get a view similar to what it used to be.

I surmise that this is not an intentional change to the way Eclipse operates and am therefore reporting this as a bug.

howlger commented 2 weeks ago

This regression might be related to the following part of code:

https://github.com/eclipse-jdt/eclipse.jdt.ui/blob/690340fdd53a50e5050c77a423dcc857c2b6f7ba/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaOutlinePage.java#L413-L414

Note: This was first asked on Stack Overflow.

iloveeclipse commented 2 weeks ago

Similar to this one: https://github.com/eclipse-platform/eclipse.platform.ui/issues/2002, related to https://github.com/eclipse-platform/eclipse.platform.ui/pull/1072.

iloveeclipse commented 2 weeks ago

@Wittmaxi : could you please check?

Wittmaxi commented 2 weeks ago

@iloveeclipse If this issue is reported to the JavaOutlinePage, then there is probably something different going on here.

The bug reported in ui was referring to the ProjectExplorer using "setAutoExpandOnSingleChildPaths" of AbstractTreeViewer, yet I don't believe this view uses that feature.

I still need to check how to solve the other issue

iloveeclipse commented 2 weeks ago

@Wittmaxi : I've just assumed that "Outline" as a "shared" view was also involved in the changes around https://github.com/eclipse-platform/eclipse.platform.ui/pull/1072.