Handy Method Parameters List Lookup

Posted on by Egor Malyshev

When you need to modify code containing the usages of methods with long parameter lists, it’s sometimes too complicated to realize what parameter you are modifying.

For example, you have a call like the following and need to know what exactly you are changing.

Method parameters lookup
You might already know that IntelliJ IDEA has the CTRL+P shortcut that brings up a brief description of which parameters are passed to the method. It’s very handy and saves a lot of time that otherwise would have been spent looking up the method declaration.

Method parameters lookup
The trick I want to tell you about is that you can use the TAB and SHIFT+TAB shortcuts, when the parameter description popup is open, to scroll through the list. IntelliJ IDEA will move the caret and highlight the parameter so you can easily see which value you are going to alter.
Method parameters lookup
Though using too many parameters in a method is rare for our team, this little feature helped out when we used code like this:

Method parameters lookup

This tip was originally posted on Javalobby
Technorati tags: , ,
Comments below can no longer be edited.

1 Response to Handy Method Parameters List Lookup

  1. Jonathan Johnson says:

    May 21, 2007

    Nice feature, but its too bad you have to have the cursor in the parameter list for Ctrl-P to work. Can you enable the Ctrl-P functionality so if you had the cursor over the method name (or when the parenthesis are highlighted) it would work as well. Right now if you enter a method without any parameters you have to put the cursor between the () to use Ctrl-P.

Subscribe

Subscribe for updates