Skip to content

Missing code assist trigger with dot ('.') when referencing an object within a 'with' closure #361

@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;
	}
}

The following Groovy class:

package test3

class MyGroovyBean {
  URL expectedUrl
}

And the following class:

package test3

import groovy.transform.CompileStatic

@CompileStatic
class TestDotCompletion {
	void doSomething(MyGroovyBean groovyBean) {
		MyBean b = new MyBean()
		b.with {
			b.url = groo|
		}
	}
}

Invoke code assist at "|", highlight the first suggestion (groovyBean) and use "." (the dot) instead of Enter to accept the proposal: completion is not performed.
This is not coherent, I use "." a lot to accept completion proposals, either in Java or in Groovy.
Please note that if you try to following (more complex) case, it works instead:

  b.url = new MyBe|

Invoke code assist at "|" and use "." to accept the MyBean() suggestion: completion is performed as expected.

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