How to fix IntelliJ IDEA method parameter auto-completion?

I am using IntelliJ IDEA 15, and I noticed that (by default) Eclipse offers a much more convenient auto-completion, when it comes to writing method calls, which require multiple parameters.

Eclipse automatically fills in default parameters and allows you to quickly navigate through them by pressing Tab:

However, IntelliJ IDEA does not handle it as conveniently and makes you write them manually:

Is there a way to make IntelliJ IDEA, handle method call auto-completion in a similar way to Eclipse's, and pre-write all the parameters for you, having you just press Tab (or another key) to navigate through them? If it is not possible in original IntelliJ, is there an add-on/plugin/external tool that will improve the intelligent code completion in such cases?


Note: I am not being lazy, it just gets quite annoying, having to manually complete each parameter and put a comma after each one, when code completion should do it for you.

Answers


IntelliJ doesn't do it and AFAIK there isn't a plugin for it. There is no solution for you (unless you built a plugin yourself, but then you'd just have another job to maintain that plugin)

The alternative is to break the habit/need for it and use IntelliJ's Code Completion shortcuts:

  • Ctrl+P to view possible parameters for function.
  • Ctrl+Shift+Space to list the possible variables that could be entered as a parameter in the respective parameter position (based on type). This also enters a comma if another parameter is required for the function.

Hardcoding numbers/strings as parameters to a custom function wouldn't be advisable as that negates the point of the parameters. It's better practice and more common to pass in a pre-defined variable; At which point Ctrl+Shift+Space is the easiest way for Code Completion. This would also prevent you from closing quotations and adding commas.

Also note: IntelliSense is Microsoft's Intelligent Code Completion implementation which neither IntelliJ nor Eclipse uses.


As frant.hartm states in their answer:

Unfortunately the view of Intellij developers is that this feature would be too error prone. See this issue on youtrack.

They even state that people are welcome to make a plugin that does this.


The closest thing to this AFAIK is "method parameter completion", which allows you to auto complete parameters of current method as parameters of the inner method call at once (works for methods and constructors when calling super()).

Unfortunately the view of Intellij developers is that this feature would be too error prone. See this issue on youtrack.


IDEA doesn't fill the arguments automatically. You can use Ctrl+Shift+Space for auto-completion (completion is based on type, not name) or Ctrl+Alt+Space for suggestion. Or Ctrl+P to see what arguments are accepted.


Try

Ctrl + Space

for

Basic Code Completion

And like previously was written

Ctrl + Shift + Space

for

Type Code Completion

or try the second variant TWICE. More about Auto-Completing Code is in here


Need Your Help

Porting a Grails application to GAE

google-app-engine grails

I currently have a Grails application I'm evaluating to port to Google App Engine and I'd like to know experiences regarding:

iOS automatically add hyphen in text field

ios objective-c hyphen

I'm learning iOS development and am having a hard time figuring out the various events for the controls. For a test I have a UITextField where the user is meant to input a string in the format: XXX...