Consider the following:
package test
class Test {
static class Foo {
String someString = 'foo'
}
static class Bar {
String someString = 'bar'
Foo foo = new Foo()
void doSomething() {
foo.with {
println "someString inside with closure = $someString"
println "someString of owner inside with closure = $owner.someString"
someS|
}
}
}
static main(args) {
Bar b = new Bar()
println "b.someString = $b.someString"
println "b.foo.someString = $b.foo.someString"
b.doSomething()
}
}
Invoke code assist at "|": Greclipse correctly suggests both Foo.someString and Bar.someString, but if you choose any of those, it completes with just someString.
However, if I choose Bar.someString, I would expect code assist to change/complete my word as owner.someString, as this is the right way (AFAIK) to actually reference Bar.someString from there.
Consider the following:
Invoke code assist at "|": Greclipse correctly suggests both
Foo.someStringandBar.someString, but if you choose any of those, it completes with justsomeString.However, if I choose
Bar.someString, I would expect code assist to change/complete my word asowner.someString, as this is the right way (AFAIK) to actually referenceBar.someStringfrom there.