I have made an event system in Kotlin where events can be listened to and broadcast, similarly to how events work in C#.
To broadcast an event, I have this line:
playerConnected.broadcast(player)
Here playerConnected is the event and player is the context object.
When debugging in IntellIJ, when "stepping into" the broadcast function to see what actions that event listeners do, it instead steps into the broadcast() function, which makes sense, and it looks something like this:
fun broadcast(args: T) {
for (listener in listeners) {
try {
listener.accept(args)
} catch (e: Exception) {
e.printStackTrace()
}
}
}
I am interested in skipping stepping into broadcast() and instead step directly into each accept() function, where listener is a Consumer<T>.
In C# I would be able to solve this by adding a DebuggerStepThroughAttribute to the broadcast() function.
Is there any equivalent attribute in Kotlin or another way to achieve the same in IntellIJ?
