-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code assist does not add necessary "owner" qualifier when accepting owner property suggestions within 'with' closure #364
Comments
The owner proposals come from this block in if (context.location == ContentAssistLocation.STATEMENT) {
ClassNode closureThis = requestor.currentScope.getThis();
if (closureThis != null && !closureThis.equals(completionType)) {
// inside of a closure; must also add content assist for this (previously did the delegate)
proposalCreatorLoop(context, requestor, closureThis, isStatic, groovyProposals, creators, true);
} One thing that is not known until runtime is the Closure's resolve strategy. It defaults to |
Looks like it can be determined by looking at the method declaration in some cases: public static <T,U> T with(
@DelegatesTo.Target("self") U self,
@DelegatesTo(value=DelegatesTo.Target.class,
target="self",
strategy=Closure.DELEGATE_FIRST)
@ClosureParams(FirstParam.class)
Closure<T> closure) |
Yes, I think some way should exist, at least for API methods, because otherwise I can't imagine how |
I see your commit of 4 days ago is referencing this bug too, but with 2.9.2.xx-201711070247-e46 code assist is still just completing to |
The commit was just a step towards identifying |
Proposal de-duplication changes for #735 have affected this use case. The proposals from both Foo and Bar will need to be offered again before the missing qualifier can be sorted out. |
Ready to test |
With 3.2.0.xx-201811292113-e48 the mentioned use case works, although I would expect Also, neither |
Please open as separate issues. If qualifier is added when required, this issue is completed. |
Consider the following:
Invoke code assist at "|": Greclipse correctly suggests both
Foo.someString
andBar.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.someString
from there.The text was updated successfully, but these errors were encountered: