When stepping into a function with the IntelliJ JV...
# getting-started
c
When stepping into a function with the IntelliJ JVM debugger, it often jumps into fields of a class of one of the parameters, why? Example:
Copy code
data class Foo(
    val a: Int,
    val b: Int, // 3
)

fun bar(a: Int, b: Int) = 
    a + b // 4

fun main() {
    val foo = Foo(1, 2)
    // 1
    bar( // 5
        5,
        foo.b, // 2
    )
}
When the debugger is stopped at
// 1
, using "step into" will lead you to the marked places in order. I don't understand why it jumps to
// 3
. Is it because it steps into the generated getter? If so, is there a way to configure IntelliJ to skip trivial getters and setters (but still step into custom getters/setters)? It's very confusing in complex code to jump to class fields on every function call.
r
Haven't tested it but there is a setting for exactly what you're describing
c
I enabled it, but it seems it doesn't change anything. I guess it only works for Java.
sad panda 1