Klitos Kyriacou
02/27/2025, 12:36 PMdata class X(val foo: Int, val bar: Int)
and use it all over the place in a large codebase, is there a refactoring (either in IDEA Ultimate Edition or in a third-party plugin or CLI utility) that will swap the two parameters to make it data class X(val bar: Int, val foo: Int)
?Joffrey
02/27/2025, 12:37 PMJonas B
02/27/2025, 12:39 PMKlitos Kyriacou
02/27/2025, 12:40 PMval (a, b) = getSomeX()
to val (b, a) = getSomeX()
?Jonas B
02/27/2025, 12:41 PMPair
then I don't think it'll work because its not your own code/signatureKlitos Kyriacou
02/27/2025, 12:42 PMJonas B
02/27/2025, 12:43 PMJonas B
02/27/2025, 12:45 PMJonas B
02/27/2025, 12:46 PMdata class A(val a: String, val b: String)
fun a() {
val (a, b) = A("a", "b")
}
turns into
data class A(val b: String, val a: String)
fun a() {
val (b, a) = A("b", "a")
}
by just running Change signature and changing the orderKlitos Kyriacou
02/27/2025, 12:49 PM