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

Wrong code assist order in method call completion #287

Closed
mauromol opened this issue May 4, 2017 · 4 comments
Closed

Wrong code assist order in method call completion #287

mauromol opened this issue May 4, 2017 · 4 comments
Assignees

Comments

@mauromol
Copy link

mauromol commented May 4, 2017

From the old GRECLIPSE-1800

Consider the following:

package c 
class C { 
    class MyBean { 
        String foo 
        int bar 
    } 
    class AnotherClass { 
        int createInt() { 
            return 1 
        } 
        String createString() { 
            return 'foo' 
        } 
    } 

    void doSomething() { 
        def a = new AnotherClass() 
        def b = new MyBean() 
        b.foo = a.cre|
    } 
}

When invoking code assist at | Greclipse is curently suggesting c.C.AnotherClass.createInt() before c.C.AnotherClass.createString(), I suspect following an alphabetical criteria, but I would expect the latter one to be proposed first, since c.C.MyBean.foo is of type String.
The same applies with the following alternative invocation:

        b.with { 
            foo = a.cre|
        } 
eric-milles added a commit that referenced this issue May 7, 2017
NOTE: This is limited to assign of property or variable expressions.
@eric-milles
Copy link
Member

Can you retest? This should be fixed.

@mauromol
Copy link
Author

mauromol commented May 8, 2017

b.foo = a.cre| and b.with { foo = a.cre| } actually work now, thank you! But if I try (combining this with ticket #286): new MyBean(foo: a.cre|), although code assist now works, the createInt is suggested first, while createString should be the preferred choice.

@eric-milles
Copy link
Member

eric-milles commented May 8, 2017 via email

@mauromol
Copy link
Author

mauromol commented May 8, 2017

Ok, so I will open another ticket for that.
This one can be closed, thank you very much 👍

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