Shortcut to see method parameters, or placeholders?

When I finish typing a method name (for call), or maybe have added a few parameters, I want to see quickly all the parameters, maybe because I forgot the some of them, or to check I'm entering them in the correct order...

In Eclipse if I remember correctly it's possible
- Shortcut CTRL+space -> shows the parameters
- After finish the name, CTRL + space will add placeholders for all the method names and I can just start typing them and then go to the next with tab.

Currently I don't know how to do any of these in IntelliJ and I always have to hover the cursor over the method name (pressing CTRL).

I'm using IntelliJ for Scala development, also Android Studio (which is based on IntelliJ and Java). Both behave the same. Don't know if it's related with the programming language.


Comment actions Permalink

Ctrl+P will show the list of parameters. The current parameter be will be in bold. You can use TAB and Shift+TAB to navigate between parameters. In the event of overloaded methods, all are shown. As you enter the parameters, any overloads that do not match are grayed out.There is a setting to indicate if you want the full signature shown or not. For example, for the String.subString method:

int beginIndex, int endIndex
@NotNull String subString(int beginIndex, int endIndex)

In order to for the parameter names to show, the source or javadoc for the library needs to be attached to the project. To set the "full parameter" option, go to File > Settings > [IDE Settings] > Editor > Code Completion. The setting is in the "Parameter Info" section.You can also enable the parameters dialog to open automatically when entering a method call.

Comment actions Permalink

Perfect, thanks!

P.S. Actually, the CTRL + P shortcut would have been easy to find in the shortcut list CTRL + SHIFT + A - "Parameter Info". Don't know why I didn't think about that. But now I got other useful information :)


Please sign in to leave a comment.