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 in static method with @CompileStatic #371

Closed
mauromol opened this issue Nov 7, 2017 · 9 comments
Closed

Missing code assist in static method with @CompileStatic #371

mauromol opened this issue Nov 7, 2017 · 9 comments

Comments

@mauromol
Copy link

mauromol commented Nov 7, 2017

Follow-up to #360.

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 {
			url.|
		}
	}
}

Invoke code assist at "|": no suggestion at all is shown.

Please note that if you remove @CompileStatic or if you replace it with @TypeChecked, it works fine.

@eric-milles
Copy link
Member

ready to test

@mauromol
Copy link
Author

Hi Eric, I tested this with 2.9.2.xx-201711160311-e46, but it works partially.
Completion invoked as "url.|" works, but if you try to invoke completion like this: "url.a|" no suggestions are shown, while I should be able to insert "url.authority".

This discrepancy on code assist "right after the dot" working, but not "after some letters have been typed", is not rare in Greclipse and is really annoying indeed :-( It makes the whole thing feel "fragile" to use.

@eric-milles
Copy link
Member

eric-milles commented Nov 16, 2017 via email

@mauromol
Copy link
Author

I understand. Do you wish me to open a separate issue for this or let we keep this bug report as the "user perspective" on proper autocompletion in this scenario?

@eric-milles
Copy link
Member

eric-milles commented Nov 16, 2017 via email

@mauromol
Copy link
Author

Don't worry Eric, no negligence by your side, you're doing a great job, really!

@eric-milles
Copy link
Member

Here's the kinda stuff I'm dealing with. No source position for the object expression (aka url) in this case.

sc-completion

@eric-milles
Copy link
Member

ready to test

@mauromol
Copy link
Author

Tested again with 2.9.2.xx-201711162156-e46, now all seems to work fine, even camel-case completion! 👍
Thank you!

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

No branches or pull requests

2 participants