Repository navigation
Conversation
In the quick selection mode, FilteredTree selected the first match in the tree. In the New wizard dialog, the filter text "File" selected "Java Project from Existing Ant Buildfile" and not the "File" wizard. Now an item with a label equal to the filter text is the best match, then an item with a label that starts with the filter text, then all other matches. When the filter text gets longer, the selection moves to a better match. When the filter text gets shorter, the selection stays while it matches. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Good evening, @merks. Could you review this one? It's been bugging me for many years. I fixed it for myself, but maybe community will also find saving a couple finger movements to create a file useful ;) |
There was a problem hiding this comment.
🟡 Changes recommended
Quick selection can replace matching selected views, miss exact matches in unexpanded branches or after rapid edits, and cause unnecessary UI-thread work in large trees.
4 open issues
What changed in this PR
Updates the workbench’s FilteredTree quick-selection mode to prefer more relevant results, addressing cases where typing “File” in the New wizard dialog selects a weaker match.
Changes:
- Ranks exact label matches ahead of prefixes and other matches.
- Adds selection-retention logic as the filter changes, without changing other selection modes.
- Updates documentation and adds three regression tests.
| File | Description |
|---|---|
| tests/org.eclipse.ui.tests/Eclipse UI Tests/org/eclipse/ui/tests/filteredtree/FilteredTreeTests.java | Tests exact-match priority, selection movement, and retention while typing. |
| bundles/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/dialogs/FilteredTree.java | Implements ranked quick selection and documents the matching order. |
Review effort: Balanced
|
That looks like a nice enhancement, thanks @anydoby. Please handle the Copilot feedback and ping me once done. We are currently in the release freeze for 2026-12 so this will have to wait a few weeks, IIRC master is supposed to open end of November again. Please also check the e4 variant (which is more modern one of the dialogs) and also see my pending change here: #4493 |
Search the filtered model, not the tree items, so a match in a branch that the refresh job did not expand is also found. Stop the search after the expand time limit and skip cycles. Compare the text of the first column. Keep a matching selection only when the filter text was made shorter than the text of the last quick selection, and reveal it. Compare the items of a multi-selection. Get the rank before the more costly match check. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
@vogella, thanks. I fixed the Copilot comments in 9c9c2c0, with a test for each one. The search now also finds matches in collapsed branches, with the same time limit as the expand step. e4 variant: I put the same change on top of #4493, with two tests in |
…rSorter Co-Authored-By: Claude Opus 5.5 <[email protected]>

In the New wizard dialog (Ctrl+N), the filter text "File" selects "Java Project from Existing Ant Buildfile" (anyone using ant today?) and not the "File" wizard for many years. It used to be correct a long time ago (maybe back it 2009 ;).
Cause: in the quick selection mode,
FilteredTreeselects the first match in tree order.Fix: the quick selection mode now selects the best match. A label equal to the filter text is first, then a label that starts with the filter text, then all other matches. Equal matches keep the tree order. When the filter text gets longer, the selection moves to a better match. When it gets shorter, a matching selection stays. Other modes do not change.
Tests: three new tests in
FilteredTreeTests; all 20 tests pass. I also tested the change in my Eclipse IDE.🤖 Generated with Claude Code