Avoid the full ancestor chain walk when removing elements from the Project Explorer - #4260
Open
vogella wants to merge 2 commits into
Open
Avoid the full ancestor chain walk when removing elements from the Project Explorer#4260vogella wants to merge 2 commits into
vogella wants to merge 2 commits into
Conversation
Contributor
vogella
force-pushed
the
navigator-parent-lookup
branch
from
August 31, 2026 12:09
6034db8 to
d93adab
Compare
Contributor
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
vogella
force-pushed
the
navigator-parent-lookup
branch
2 times, most recently
from
September 1, 2026 08:02
f78b390 to
61c2e4d
Compare
…getParent getParent() resolved overriding extensions up front, so for an element covered by an overriding extension it called that extension's plain getParent() and never consulted the overridden extension or the override's getPipelinedParent(). getParents() takes the other route: it asks the overridden extension and pipes the result through the overriding extensions, which is what IPipelinedTreeContentProvider promises. The pipelining code in getParent() was unreachable for the same reason, and it also handed the Object[] holder to pipelineParent() instead of the parent it held. Compute the parent with findParents(), which getParents() already uses for each level, and drop pipelineParent(). Assisted-by: multiple AI agents and layers of automated tooling 🤖
AbstractTreeViewer.getParentElement() prefers ITreePathContentProvider, so for the Common Navigator it calls getParents(), which compiles complete paths up to the root. Only the last segment of the first path is used, so every ancestor level above the immediate parent is computed and discarded, and each level asks every enabled content extension for a parent. With JDT enabled that runs JavaCore.create and hasJavaNature per level, which hit the workspace tree. AbstractTreeViewer.internalRemove() takes this branch for elements that have no widget, so deleting many never expanded files paid the full walk per element and froze the UI. Override getParentElement() to ask getParent() first and fall back to the inherited behaviour when it returns null. Assisted-by: multiple AI agents and layers of automated tooling 🤖
vogella
force-pushed
the
navigator-parent-lookup
branch
from
September 2, 2026 15:24
61c2e4d to
14e9435
Compare
vogella
added a commit
to vogella/eclipse.platform.ui
that referenced
this pull request
Sep 3, 2026
…removing elements from the Project Explorer
vogella
added a commit
to vogella/eclipse.platform.releng.aggregator
that referenced
this pull request
Sep 3, 2026
Upstream master plus these PRs: eclipse.jdt.core -> https://github.com/vogella/eclipse.jdt.core.git vogella-master @ a4eb5e4ef8 (eclipse-jdt/eclipse.jdt.core#5309) eclipse.platform.ui -> https://github.com/vogella/eclipse.platform.ui.git vogella-master @ 51e813eec6 (eclipse-platform/eclipse.platform.ui#4260 eclipse-platform/eclipse.platform.ui#4304 eclipse-platform/eclipse.platform.ui#4305 eclipse-platform/eclipse.platform.ui#4326 eclipse-platform/eclipse.platform.ui#4327) eclipse.jdt.ui -> https://github.com/vogella/eclipse.jdt.ui.git vogella-master @ 2073494827 (eclipse-jdt/eclipse.jdt.ui#3142 eclipse-jdt/eclipse.jdt.ui#3131 eclipse-jdt/eclipse.jdt.ui#3127 eclipse-jdt/eclipse.jdt.ui#3058) eclipse.pde -> https://github.com/vogella/eclipse.pde.git vogella-master @ 55877fce19 (eclipse-pde/eclipse.pde#2463 eclipse-pde/eclipse.pde#2444 eclipse-pde/eclipse.pde#2443)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deleting many files below a collapsed folder freezes the Project Explorer. AbstractTreeViewer.getParentElement prefers ITreePathContentProvider, so the Common Navigator answers through getParents, which compiles complete paths up to the root although only the last segment of the first path is ever used. AbstractTreeViewer.internalRemove takes that branch for every element without a widget, and with JDT enabled each ancestor level runs JavaCore.create against the workspace tree. Measured in a running IDE, deleting 2000 files ten folders deep froze the UI for 19 s; with this change the same removal is not measurable and no freeze is logged.
CommonViewer now asks getParent first and falls back to the inherited behaviour when it returns null, which confines the change to the Common Navigator. For that to be correct, getParent had to honour pipelined overrides: it resolved overriding extensions up front and called the override's plain getParent, so getPipelinedParent never ran and the pipelining code in getParent was unreachable. It now reuses findParents, the per-level routine getParents already uses, so both lookups agree. Two tests pin this: one that the override's getPipelinedParent is consulted, one that removing an unexpanded element computes exactly one parent.