IntelliJ IDEA knows that the b method used in a.b() is defined in A.metaClass.b = {}.
class A {
def a() {
return 1
}
}
A.metaClass.b = {
return 2
}
def a = new A()
println a.a()
println a.b()
It would be nice if the Groovy language server could support this feature.