Commit 3aaea37
committed
Defer expensive project reference computation during selection changes
CloseUnrelatedProjectsAction.getSelectedResources() calls
computeRelated() which triggers buildConnectedComponents() and
getReferencedProjects() for every project in the workspace. This is
expensive because it can trigger classpath container resolution.
Previously, the inherited updateSelection() called getSelectedResources()
on every selection change, causing this expensive computation to run on
the UI thread during startup and navigation. This blocked the IDE.
Override updateSelection() to perform only a cheap enablement check:
verify the selection contains at least one open IProject. The expensive
computeRelated() call is deferred to getSelectedResources(), which is
only invoked when the action is actually executed via run(). This is
correct because getSelectedResources() already handles the selectionDirty
flag and recomputes projectsToClose lazily when needed.
Fixes #26361 parent 6de4edc commit 3aaea37
1 file changed
Lines changed: 20 additions & 0 deletions
File tree
- bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
130 | 131 | | |
131 | 132 | | |
132 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
133 | 153 | | |
134 | 154 | | |
135 | 155 | | |
| |||
0 commit comments