Intellij how to add call hierarchy to mouse popup menu? - intellij-idea

Is there a way to add Call Hierarchy to mouse popup menu in Intellij? I use it a lot and hope it is available on the mouse right click popup menu.

This works on Intellij IDEA Ultimate 2018.1.3:
From the File menu select Settings...
In the left panel select Appearance & Behavior > Menus and Toolbars.
In the right panel expand the Editor Popup Menu entry.
Select the final entry of that menu, which (for me) was JSP Actions.
Some buttons on the right should now be enabled. Click the Add After... button:
The Choose Actions To Add dialog opens. Navigate to the Call Hierarchy entry:
Expand the Main menu entry, then expand the Navigate entry.
Scroll down and select the Call Hierarchy entry.
Click OK to close the Choose Actions To Add dialog.
At the end of the list of menu entries there should now be a new entry for Call Hierarchy.
Click OK to close the Settings window.
Position the mouse cursor over a method in the editor window, right click and select Browse Call Hierarchy from the bottom of the popup menu:

Related

Add right click menu item inside gutter of vscode

How to add right click menu inside the editor's gutter of vscode.
I want to have a provision to show/hide line numbers option on the right click inside the editor's gutter.
I am not sure about the extension point for this.
Unfortunately, this is not possible, yet.
I have filled an issue, "OnClick event on Gutter #5455" sometime ago, but it is still open, and no Milestone defined.

How to trigger Eclipse-like cmd+click in IntelliJ?

How do i trigger the cmd + click behaviour (Go to Class, go to declaration etc) in IntelliJ when my current keymap uses Eclipse (MacOS)?
I'm currently switching from Eclipse/STS to IntelliJ. So far, i've changed the keymap to use Eclipse (MacOS), so most of the familiar keyboard shortcuts i use still works.
control + click does the functionality that i want using Eclipse (MacOS) keymap but this also triggers system behaviour of right click, so menu pops out the same time that the go to class/variable triggers. Is there a way i can set or use cmd + click to trigger the desired behavior?
Go to Preferences > Keymap.
You have to copy the Eclipse (MacOS) keymap to a new name, in order to make changes: select the Eclipse (MacOS) keymap, press the Copy button and give it a new name, e.g. Eclipse (MacOS) 2.
Then click into the filter field, enter declaration, then in the tree area do right-click on the Main menu > Navigate > Declaration line in order to activate the context menu. The result should look like this:
Select Add Mouse Shortcut from the context menu, a dialog opens. Perform into this dialog the key + click combination you wish to add, in your case cmd + click:
Confirm the new Mouse shortcut with Ok, then close the Preferences dialog also with Ok or Apply. Done.
Note: you can delete the ctrl + click mouse shortcut, if you wish to not use it by mistake, by selecting Remove ^Button1 Click in the context menu.

How to reopen project viewer in IntelliJ IDEA

I can't figure out how to re-open the tab on the left (solution viewer) in IntelliSense Idea.
Anyone know ?
In the left bottom corner you will find a small icon. You can either move your mouse over it and select Project or click on this icon to toggle the visibility of all tabs (which you can click on to open the corresponding view).
You can also use the shortcut Alt + 1 to toggle the Project View.

Choose between open declaration/implementation on Ctrl + click in IntelliJ IDEA

Details:
IDE: IntelliJ IDEA 14
O.S.:: Windows 7
If I want to navigate to the declaration of a method I can choose one of the following approaches:
press Ctrl + left click
right click > Go To > Declaration
press Ctrl + B
If I want to navigate to the implementation of a method I can choose one of the following approaches:
press Ctrl + Alt + left click
right click > Go To > Implementation(s)
press Ctrl + Alt + B
In Eclipse, if I press Ctrl and the mouse is over a method, a popup appears and I can choose what to do (go to Implementation/Declaration). If I press "left click" ( Ctrl is still pressed ) the first option will be chosen.
How can I achieve the same / a similar behavior in IntelliJ IDEA ?
There is not a built-in option for this. You would need to configure a custom quick list to do such.
Open the Settings dialog and go to "Quick Lists" (It's under "Appearance & Behavior" in IDEA 14)
Click the add button to the right of the middle pane
Give your list a name
Click the add button to the right of the far right pane (where is reads "no actions")
Add the Go to Declaration action (Main Menu > Navigate > Go to Declaration)
Add the Go to Implementation(s) action (Main Menu > Navigate > Go to Implementation(s))
Click Apply
Go to Keymap in the settings
Under the "Quick List" node, find the Quick List you just created and map a short-cut (keyboard or mouse) to it. You can, of course, remap one of the shortcuts used by the Go to Declaration or the Go to Implementation(s) action
Click OK to close out of the settings and give it a try.
Note that in the quick list that opens, you will have numbers next to each action for quick selection.
Edit:
Adding a screenshot of final quick list for additional clarity
I was looking for the same thing, because I was also used to it in Eclipse. Nevertheless, in 99% of the cases, I went to the implementation. If that's your case too, you may consider changing the Ctrl+click shortcut in IntelliJ:
Open File → Settings... → Keymap
Search for "implementation", and identify the item "Main menu → Navigate → Implementation(s)" in the list
Right-click the item and choose "Add Mouse Shortcut"
Add the Ctrl+click shortcut by making a Ctrl+left click on the window
When hitting the OK button, you have two choises :
Remove the existing shortcut (opening the declaration)
Leave the existing shortcut : In that case, when using then Ctrl+click, both the declaration and the implementation will be opened (at least when they are in different files)
I know this answer comes like 2 years too late, but hopefully it may help others?
EDIT : This shortcut also applies when you want to navigate to the declaration of a super class. Therefore, my "99%" first declared above drops a bit.
I've added the ctrl + right-click as a shortcut to go the declaration (which conflicts with no other shortcut - but you need a mouse with at least two buttons...).
If you select the method and hit Ctrl+T it will show the implementations of the methods. You can click on the options to navigate to that implemented method. Hope this helps.
On mac you can open the implementation(s) with command + option + click. Right -click on the method and check "go to" for the other options and shortcuts you might need.
My IntelliJ (2016.2) shows the declaration of a method (in a PHP interface) as one of the implementations in the implementation popup, so maybe you can do this all from the Implementations popup now.

IntelliJ 13 - Add Navigate Back/Forward to toolbar?

Jetbrains changed the toolbars in IntelliJ 13.
The Navigate Back & Forward arrows, shown here, used to be in the top toolbar and easily clickable.
Now the only way I can find to access these fields is to go to Navigate -> Back or Navigate -> Forward.
Does anyone know of a way to add these back/forward locations into an always visible toolbar like they were located in IntelliJ 12?
For some reason the toolbar is not visible by default.
In the View menu, select Toolbar. That should fix it.
I am using Idea 13 and my toolbar already has these buttons:
The icon groups are:
file | undo/redo | cut/copy/paste | font size | back/forward | compile/run | vcs | config | help | jira | tasks
You should be looking at the back/forward buttons in the 5th group.
If you want to make the toolbar visible, it's one of the checkable options on the view menu.
IntelliJ IDEA 15
Show toolbar
Method 1
View > Toolbar
Method 2
Press Shift 2 times > write "toolbar" and click on the "switch button" to change "OFF" in "ON":
The toolbar already contains the "Back" and "Forward" buttons.
Configure toolbar
Method 1
File > Settings... > Appearance & Behavior > Menus and Toolbars > Main Toolbar > select one row and click on "Add After..." if you want to add a new button (E.g.: if you accidentally removed the Forward button and you want it back)
Method 2
Right click on the toolbar > Customize Menus and Toolbars...
Use the approach that is described in Method 1
To enable toolbar in intellij 2019.3,
Just go to the "View" tab and check-enable "Toolbar"
*be noted that shortcut keys(ctrl+alt+ left/right) are not working
Here is just a reference image, where to find the top right bar in the settings.
(Note: This is PyCharm)
The Conan's answer helped me with the same issue. 2Conan - make your comment as an answer. It helps with TS issue. Just for sure posting his answer here ...
OK, you can do this. Turn the toolbar on, with View > Toolbar. Right click it, and choose Customize Menus and Toolbars. In the Navigation Bar Toolbar folder, add the icons from Main menu > Navigate > Back / Forward, choose OK, then go and turn off the toolbar with View > Toolbar again.