Handy Method Parameters List Lookup
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.
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.
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.
Though using too many parameters in a method is rare for our team, this little feature helped out when we used code like this:
Jonathan Johnson says:
May 21, 2007Nice 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.