Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the return type of a method call in IntelliJ?

Normally you would expect just hovering over a method it would show a popup of the return type.

How do you get this information in intellij ultimate?

like image 412
loyalflow Avatar asked Nov 19 '12 21:11

loyalflow


People also ask

What is the return type of () method?

A method returns to the code that invoked it when it completes all the statements in the method, reaches a return statement, or throws an exception, whichever occurs first. You declare a method's return type in its method declaration. Within the body of the method, you use the return statement to return the value.

How can see method call in IntelliJ?

on the toolbar in the Find tool window or press Ctrl+Alt+Shift+F7 . While in the Find tool window, you can also use the Preview area to check the places where the usages were found, to see a call hierarchy for methods, data flow for fields, and so on.

How do I get method definition in IntelliJ?

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).

How do I extract a method in IntelliJ?

To extract method:Press Ctrl+Alt+M or from the main menu, select Refactor | Extract | Method. In the dialog that opens, configure a method options, such as visibility, parameters, and so on. You can also change a name of the method if you need. Click OK.


2 Answers

You hover it and hold down CTRL in windows or CMD in Mac

like image 168
ScottShamus Avatar answered Oct 21 '22 08:10

ScottShamus


Hit Ctrl + Q (or ⌃J on Mac) when cursor is on a method declaration or call. It will show you the pop-up you want. As a bonus: Ctrl + Shift + I will display method body as well in a pop-up.

like image 38
Tomasz Nurkiewicz Avatar answered Oct 21 '22 08:10

Tomasz Nurkiewicz