Skip to content

Improve goto/jumpto search windows#8896

Merged
mbien merged 2 commits intoapache:masterfrom
mbien:improve-goto-search
Oct 13, 2025
Merged

Improve goto/jumpto search windows#8896
mbien merged 2 commits intoapache:masterfrom
mbien:improve-goto-search

Conversation

@mbien
Copy link
Copy Markdown
Member

@mbien mbien commented Oct 9, 2025

This is about the goto/jumpto dialogs which open with ctrl+O, alt+shift+O and ctrl+alt+shift+O

first commit:

  • make exact search mode follow the case sensitivity settings (e.g 'list ' (note the space postfix) will now also show 'List' among the results when case sensitivity is disabled)
  • add missing exact search instructions to file search label (other windows had those, see screenshot)
  • file search: selection should stick to first item until user changes selection. Async search could otherwise insert better matches above the selected item.
  • disable "prefer opened projects" by default (see screenshot, its now a checkbox)
  • CI: enabled tests
  • other minor improvements

the "prefer opened projects" setting can lead to confusing results when good matches are displayed far away from the first (worse) match, potentially outside of the visible viewport. The implementation itself works correctly but it might be better as toggle in the search window settings instead of the more hidden global options. When a user clicks on it, at least he/she is aware that it is enabled.

second commit:

  • removed the "prefer opened projects" setting from global options and moved it to the three search windows
  • generics and related language renovations
  • file search: renamed "Search by Folder" to "Search by Path"
  • updated mnemonics
image

(other two windows look similar, but they may have less options)

fixes #4311

https://issues.apache.org/jira/browse/NETBEANS-3808
https://issues.apache.org/jira/browse/NETBEANS-3017

@mbien mbien added this to the NB28 milestone Oct 9, 2025
@mbien mbien added Editor ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Oct 9, 2025
@mbien mbien force-pushed the improve-goto-search branch from 4369b9e to b6818ce Compare October 10, 2025 02:53
@mbien mbien changed the title Improve goto search functionality Improve goto search windows Oct 10, 2025
@mbien mbien changed the title Improve goto search windows Improve goto/jumpto search windows Oct 12, 2025
Copy link
Copy Markdown
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only eyeballed, but looks sane to me. Thank you.

mbien added 2 commits October 13, 2025 20:23
 - make exact search mode follow the case sensitivity settings
 - add missing exact search instructions to file search label (other
   windows had those)
 - file search: selection should stick to first item until user changes
   selection. Async search could otherwise insert better matches above
   the selected item
 - disable "prefer opened projects" by default
 - CI: enabled tests
 - other minor improvements

the "prefer opened projects" setting can lead to confusing results
when good matches are displayed far away from the first (worse) match,
potentially outside of the visible viewport. The implementation
itself works correctly but it might be better to change it into
a filter instead of model comparator in future and consolidate
the UI/settings of the 3 search dialogs.
 - removed the setting from global options and moved it to the three
   search windows
 - generics and related language renovationss
 - file search: renamed "Search by Folder" to "Search by Path"
 - updated mnemonics
@mbien
Copy link
Copy Markdown
Member Author

mbien commented Oct 13, 2025

thanks, rebasing and merging after some more manual tests

@mbien mbien force-pushed the improve-goto-search branch from b6818ce to 7d9ed0e Compare October 13, 2025 18:28
@mbien mbien merged commit 52264d2 into apache:master Oct 13, 2025
30 checks passed
@eirikbakke
Copy link
Copy Markdown
Contributor

Thank you! I remember there were various problems with "Go to Symbol" at some point, which made me use "Go to File" only for several years. I will see if Go to Symbol starts becoming useful again after these tweaks (and now that there has been another few years of other NetBeans updates as well).

@mbien
Copy link
Copy Markdown
Member Author

mbien commented Oct 14, 2025

@eirikbakke there are a few more things wanted to try but left it for later. E.g would be good to consolidate features between all 3 dialogs. NB is hit by a severe case of code duplication in several areas which caused the goto feature too to get out of sync between the 3 dialogs.

We could even consider making that one dialog which can switch between 3 modes, (hotkeys would still open the right mode so that usage would not be influenced). Tweaking the comparators is also an option, but before doing that we have to define what we want from the "prefer x" stages - maybe it should be a simple filter and not implemented in the comparator.

@eirikbakke
Copy link
Copy Markdown
Contributor

@mbien One of the main problems for me was that Go to Symbol sometimes omits symbols that should be present. I started debugging this a long while back, and concluded it was probably a race condition in the UI code, rather than a problem with the symbol index. (The right symbols appeared when I did System.out.println statements, but they never appeared in the UI list.) Indeed looking at the UI code for Go to Symbol it looked very complex, and I ran out of time to investigate it.

@eirikbakke
Copy link
Copy Markdown
Contributor

I finally got around to investigating the "missing classes in Go to Symbol" problems I described earlier. Here's a PR that fixes them: #9327

The problem was not a race condition in the UI code, but rather a mis-configured ".sig" file reader which failed when trying to load index data for Java classes with certain (quite common) features in them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent "Go To File" results

3 participants