Say, I have a `data class C(val x: X, val y: Y, va...
# intellij-tricks
m
Say, I have a
data class C(val x: X, val y: Y, val z: Z)
, and I want to create an instance. When I write something like
val c = C(
is there a shortcut how intellij includes all members with names? Like
val c = C( x = |, y = , z = )
(where
|
is the cursor position)
m
Hey 🙂
I think you can type Alt + Enter and add all names (as long as the constructor is complete)
@Manuel Dossinger it all depends on the cursor position though - you have to be close or on the constructor for that suggestion to appear
m
Ah, cool, didn't know that. Sounds useful 🙂 But can I also do something for a non-complete constructor? Such that I don't have to lookup the arguments this class needs in the first place?
w
Replying because might be useful for future readers https://plugins.jetbrains.com/plugin/14168-kotlin-function-arguments-helper
m
This plugin is great - it should be part of the standard Kotlin/IDE setup!