-
Notifications
You must be signed in to change notification settings - Fork 855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement CMD+CLICK
on Symbol Declarations to Find Usages Instantly
#7915
Comments
CMD+CLICK
on Symbol Declarations to Find Usages QuicklyCMD+CLICK
on Symbol Declarations to Find Usages Instantly
good idea. The tricky part is that collecting usages can take some time in larger projects - and thats when popups become less interesting again UX-wise compared to dedicated views. (there is also a second action for the call hierarchy which is similar to find usages) |
@mbien Thank you for the feedback! Regarding the concern about usage collection time in larger projects, this proposal could help by implementing a streaming approach, allowing results to appear incrementally as they’re discovered. Rather than waiting for the full set to load, developers could interact with initial results immediately. This would give faster feedback, making the popup more practical, even in large codebases, by balancing immediacy with responsiveness. As for the "call hierarchy" action, it provides valuable insights but with a different focus. For example, consider the following classes: class Foo {
void ping() {
System.out.println("pong");
}
}
class Bar {
void check() {
new Foo().ping();
}
} If we search for usages of I'm happy to clarify further if needed! |
This will break down once people want a particular order in the results and that would mean, that literally anytime the order could change and you are never sure, whether your mouseclick would reach "the right" entry. |
Currently, the “Find Usages” tool in NetBeans doesn’t seem to provide options for ordering results, so introducing the Additionally, I haven’t encountered scenarios where order was critical while checking usages. In most cases, being able to examine any usages quickly is the primary goal. For users who do need ordering, perhaps a default option could be introduced in future iterations, configurable in NetBeans settings. |
The thing with timing could be easily "workaround" by ordering the stuff which is really fast and more relevant than others and the rest can be added under a line like "see more" or smth. The same timing issue is a problem for find a file which brings this flaky jumping and reordering, which could also be fixed by "see more" a split view "most relevant" "less relevant". Etc. |
Also, I mean it doesn't need to be instantly visible, this idea here is about instantly (maybe this could be a bit wrong here) without having an extra popup before. It can take time if the user see smth happening and then let's give the stuff to the user. |
Find usage should do the trick with default settings, coming from the popup which will not be shown but just trigger and then let's wait. Maybe the indexer and everything else needs an improvement too but this is another topic. |
there is an argument to be made that find-usages is the reverse of the navigate-to action and would therefore deserve its own navigation mechanism (analog to navigate-to decl/impl). ctrl+click would jump to the declaration, while ctrl+shift+click would open the usages list for example for the reverse. In practice this will quickly hit a limit though since the actions aren't symmetric. Find usage results can be a long list which might not make sense to be displayed in a context menu. This is also the reason why there are so many configuration options for the usages query. There is also likely no good default - I change the search scope fairly often for example. There is also a second problem: how often do you actually want to jump to only one specific usage item? What do you do if this isn't the right item - navigate back to run the query again to select something else? I am not convinced about this usage pattern - given that the dedicated usage window is one shortcut away. (it might be interesting to experiment with a specialized menu for navigation actions, analog to the alt+insert menu. Instead of running the query it would simply aggregate all navigation actions which make sense to this item via ctrl+right click for example) |
It should not jump to the first element that was found, if there are more. It should show me all available usages and let me jump to that that I need or want. Also it is not about jumping instant to somewhere, it is about to prevent this configuration popup before. Also if we can't find a default let's do this:
|
nobody said that it should |
Maybe I get this wrong. Anyway I think there are solutions for this instead of say no to new features. Other IDEs can do this and we should start adapt features that are used everyday and I know the features also for CSS and TS that I use it in VS Code. Back in the days they started cloning features of us nowadays it should be the way around. IMHO. And yes I know, someone needs to do it |
what are you talking about? who said no to new features? The feature is already there (literally one shortcut away, including async updates), this is only about a different way to present it in the UI. Popup vs window. I don't have anything against it in principle - it has to make sense in NB though. Possible problems should be cleared up before implementing something, not when the PR is already open. |
The behavior I’m suggesting for the NetBeans @Chris2011 By "instantly," I don’t mean that all search results load instantaneously but rather that the popup itself should appear right away with any initial results, even as more results load progressively (this will still be quick, as is the case with "Go to File"). Currently, even with the The following points address some specific feedback:
This streamlined approach aims to improve efficiency by allowing users to access "find usages" results without the interruption of an initial configuration popup, letting them focus on the actual search and refinement steps. |
I have no issue with adding an alternative UI for Find Usages, but I have a few comments:
|
Thank you, @lahodaj, for the detailed input! I appreciate the insights on the current state of the "Find Usages" feature, particularly regarding the immediate display and incremental loading of results, which I hadn’t fully realized before. I also understand the limitations around development resources. However, several specific usability aspects still make this proposal relevant and valuable:
I’d be very interested in becoming a significant contributor to the implementation of this alternative UI and am keen on any guidance to help get started. It would be great to have some initial direction on contributing to NetBeans in this area so that I can be as effective as possible. I believe these adjustments would streamline the "Find Usages" experience, making it more intuitive and responsive to developer needs. I look forward to any further feedback on refining this idea! |
Description
NetBeans currently provides a way to find usages of symbols using CTRL + F7. This method presents a dialog box that requires users to optionally modify the find parameters before clicking the "Find" button.
I propose the implementation of a CMD + CLICK feature that allows users to instantly view usages of a symbol (e.g., a method name) declaration without the need for an initial dialog box. This functionality would mimic the approach found in IntelliJ, where CMD + CLICK on a symbol opens a popup displaying the default results for usages immediately. Users would still have the option to change the find parameters after the initial results are loaded.
Additionally, the CTRL + F7 option loads all usages at once, requiring developers to wait for results to become available. The CMD + CLICK option should adopt a streaming style, presenting usages as they are discovered, thereby enhancing the overall user experience.
Use case/motivation
Finding usages is one of the most frequently performed actions during coding, whether in the writing or refactoring phases. Instant feedback through a CMD + CLICK option will allow developers to make quicker, informed decisions, ultimately boosting productivity and streamlining workflow.
Related issues
None identified.
Are you willing to submit a pull request?
Yes
The text was updated successfully, but these errors were encountered: