How do I use IntelliJ to auto-complete method parameters?

AutocompleteIntellij Idea

Autocomplete Problem Overview


A feature in Eclipse that I really miss is how you can auto-complete method parameters with currently in-scope variables. This feature will, with a single key combo (ctrl+space) fill in all method parameters. As long as my variables were named similarly to the method parameters, I never had a problem with this auto-complete. Is there a plugin or a native way to accomplish this in Intellij?

Autocomplete Solutions


Solution 1 - Autocomplete

You might already know that IntelliJ IDEA has the CTRL+P shortcut (Windows) and CMD+P (OX X) 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.

Solution 2 - Autocomplete

IntelliJ IDEA 9 now supports what they call "super completion" which matches the behavior you are looking for and is available through their early access program.

alt text
(source: jetbrains.com)

IntelliJ IDEA 8 does not allow you to autocomplete more than one parameter at a time. You are forced to use Control-Shift-Space once for each parameter.

Solution 3 - Autocomplete

Control-Shift-Space (and the completion is based on type, not name)

For more goodness: Help -> Default Keymap Reference

Solution 4 - Autocomplete

There is also an IntelliJ plugin called 'kotlin-fill-class' that will fill in some default values automagically. Tested the latest snapshot version of the plugin with IntelliJ 2019.1 and it appears to be working.

Solution 5 - Autocomplete

from this post: https://stackoverflow.com/a/55160515/405749:

The plugin https://plugins.jetbrains.com/plugin/8638-auto-filling-java-call-arguments at least will provide a smart fix to do it when pressing alt+enter.

I have not found a away to do this completely automatically as it works in eclipse.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser17854View Question on Stackoverflow
Solution 1 - AutocompleteDmitry LView Answer on Stackoverflow
Solution 2 - AutocompleteAlex BView Answer on Stackoverflow
Solution 3 - AutocompleteCraig DayView Answer on Stackoverflow
Solution 4 - AutocompleteBrooks DuBoisView Answer on Stackoverflow
Solution 5 - AutocompleteelonderinView Answer on Stackoverflow