Skip to content
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

Missing code assist within 'with' closure in static method #360

Closed
mauromol opened this issue Nov 2, 2017 · 4 comments
Closed

Missing code assist within 'with' closure in static method #360

mauromol opened this issue Nov 2, 2017 · 4 comments

Comments

@mauromol
Copy link

mauromol commented Nov 2, 2017

Consider the following Java class:

package test3;

import java.net.URL;

public class MyBean {

	private URL url;
	
	public URL getUrl() {
		return url;
	}
	
	public void setUrl(URL url) {
		this.url = url;
	}
}

And the following Groovy class:

package test3

import groovy.transform.CompileStatic

@CompileStatic
class TestDotCompletion {

	static main(args) {
		MyBean b = new MyBean()
		// b.url.getAuthority()
		b.with {
			u|
		}
	}
}

Invoke code assist at "|" (I want to reference b.url): no suggestion for b.url is given. I would expect to find it as the top candidate.

Please note that if the method main is not static, code assist works ok for this case.

@mauromol mauromol changed the title Missing code assist within 'with' closure Missing code assist within 'with' closure in static method Nov 2, 2017
@eric-milles
Copy link
Member

ready to test

@mauromol
Copy link
Author

mauromol commented Nov 6, 2017

Hi Eric, I tested this with 2.9.2.xx-201711060326-e46 and now u| is correctly completed inside the with closure. However, any attempt to request further code assist on url.| fails (no suggestions at all).
Should we open a new issue or rather keep this open?

@eric-milles
Copy link
Member

Without the @CompileStatic the requested completions appear. Static compilation has some strange AST conversions built into it. I will need to decipher just what structure is there for url.|.

@eric-milles
Copy link
Member

Can you open a separate ticket? I know it seems lame, but the missing proposal for url is there now so the original issue has been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants