Android Studio “Open Declaration” like eclipse

后端 未结 7 785
不知归路
不知归路 2020-12-29 20:18

Is there a function like the \"open declaration\" in eclipse, that we can use in the new Android Studio?

Just like F3 button.

相关标签:
7条回答
  • 2020-12-29 20:44

    File - Settings - Keymap - Eclipse sets all shortcuts "Eclipse like"

    0 讨论(0)
  • 2020-12-29 20:53

    You can click middle mouse button and android studio open declaration or all usage locations of method/variable;

    0 讨论(0)
  • 2020-12-29 20:57

    Here are more details to help you avoid asking the same question for all the other commands:

    Press Ctrl + Shift + A, and search for the command you're looking for ("declaration") for example. This finds the command "Declaration - Goto by Reference action - Ctrl + B".

    So you just need to put your cursor on the method you want to go to, and press Ctrl + B? You can also Ctrl + Click to achieve the same goal.

    The most useful keyboard shortcuts are described in the Help - Tip of the day dialog box. Read them all.

    0 讨论(0)
  • 2020-12-29 21:01

    In Preferences, I added the shortcut to Navigate->Declaration in Keymap:

    Android Studio/IntelliJ Keymap screen -> add a shortcut for Declaration

    The cmd+button1 click was added with right click, "add mouse shortcut".

    It is interesting, that to make it 'fully' eclipse like, you may want to make the Javadocs appear on hover. For that you must set "Show quick doc on mouse move" up in the Editor->Other section.

    Setting up Show quick doc on mouse move in Editor->Other section

    0 讨论(0)
  • 2020-12-29 21:08

    In IntelliJ-IDEA it's Right-Click => Go To => Declaration. As others noted, Android Studio is based on IntelliJ-IDEA and in most of the cases, the experience would be the same.

    0 讨论(0)
  • 2020-12-29 21:08
    1. CTRL+B or

    2. Right click, Go to -> Declaration

    3. For Mac: CMD+B

    0 讨论(0)
提交回复
热议问题