I quite often need to specify all / a lot of named...
# intellij
j
I quite often need to specify all / a lot of named parameters. Is there a shortcut in IntelliJ to fill out all parameters (like in the second screenshot), and let my cursor jump from one to another like in a live template?
plus1 4
w
There's a plugin called Kotlin Fill Class I think that does what you want, I use it daily and it's brilliant
👏 1
👍 2
👏🏾 1
j
@wasyl Amazing! Exactly what I need. Tyvm!
w
Semi-related I'd rather vote and prioritize https://youtrack.jetbrains.com/issue/KTIJ-20757/Add-a-way-to-prevent-the-automatic-creation-of-trailing-lambdas, as this one is not workaroundable by an external plugin
Overall named parameters story could be improved in couple of areas IMO, from top of my head: • named parameters are notoriously difficult to get as one of the first IDE suggestions on cmd+space/cmd+shift+space • it's not possible to encourage or force IDE (e.g. with an annotation) to use named parameters for a given class/package • adding new parameters doesn't by default append parameter name even if all the existing parameters already have names (so it's almost certain new parameters should also use names) • the issue I linked, incredibly annoying, conversion from named parameter to a trailing lambda on any refactor
🙏 1
j
One other tiny thing I missed the last days which is related to your suggestions: • IDE suggestion to add named parameters on all call sites of a function.