Skip to content

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

@mauromol

Description

@mauromol

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions