In IntelliJ I can very easily find usages of an enum constant by Ctrl + left click on an enum constant. However, if the enum implements a constructor, I'm going directly to that constructor instead.
I know I can also search for usages with Alt + F7 but is it possible to always do that on Ctrl + left click even if there is a constructor?
In the editor, select a symbol for which you want to see the usages. From the main menu, select Edit | Find Usages | Show Usages In Code Ctrl+Alt+F7 . The usages window shows the current scope and total count of usages. If you want to quickly switch to the default scope, press Ctrl+Alt+F7 .
Use ⇧⇧ (macOS), or Shift+Shift (Windows/Linux), to bring up the Search Everywhere dialog. You can search across Classes, Files, Symbols and Actions. You can also use forward slash to filter the results to a specific area, such as /editor.
By default, IntelliJ IDEA shows all classes, methods, and other elements of the current file. To toggle the elements you want to show, click the corresponding buttons on the Structure tool window toolbar. to show class fields. to have protected class members shown in the tree.
In IntelliJ IDEA, you can see where and how symbols, such as tags, classes, fields, methods, or functions are defined in your project. For this purpose, the IDE features the Quick Definition popup. To view definition of a symbol, select it in the editor and press Ctrl+Shift+I (or click View | Quick Definition).
In the editor, select a symbol for which you want to see the usages. From the main menu, select Edit | Find | Show Usages Ctrl+Alt+F7. The usages window shows the current scope. If you want to quickly switch to the default scope, press Ctrl+Alt+F7
Source: https://www.jetbrains.com/help/idea/find-highlight-usages.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With