Debugging groovy closure created in ASTTransformations
Hello
I am using a groovy AST to wrap all code in my function. This happens without the IDE knowing about it because it happens at runtime. Therefore when I setup my breakpoint, it thinks the breakpoint is at file Flow.groovy:23 but at runtime, because the closure is a separate class, the breakpoint really needs to be in another closure class at a different location. Per the IDE. The first image is before I started to debug. Notice that a closure in the script shows breakpoint info reflecting the same file name. But during debug, the breakpoint is actually in a diffferent class/location. How does Groovy achieve this? I possibly need to do something similar right?
请先登录再写评论。
To do this better you should work with closures in Groovy, these closures can be mapped to separate classes or objects at runtime, creating a difference between the source code location in the IDE and the actual running program.
https://intellij-support.jetbrains.com/hc/en-us/community/posts/206635495-Groovy-generated-classes-causing-compilation-issues Geometry Dash Lite