Skip to content

Guessed enum values proposed without qualification when invoking a method #367

@mauromol

Description

@mauromol

This was the old GRECLIPSE-1705

Consider the following Java enumeration:

package b;
public enum MyEnum {
	VAL1, VAL2, VAL3;
}

The following Java class:

package b;
public class Utility {
	public static void doSomething(MyEnum enumValue) {
	}
}

And the following Groovy class:

package b 

class Test4 { 
	void doSomething() { 
		Utility.doSomet|
	} 
}

Ensure that the option Groovy | Editor | Content Assist | "Use guessed arguments for method calls" is checked.

Invoke code assist at "|". As you can see, MyEnum.VAL1, MyEnum.VAL2 and MyEnum.VAL3 are correctly proposed, however alongside them there are also the unqualified VAL1, VAL2 and VAL3. If you choose one of the unqualified choices, they are inserted "as-is", which is quite useless, unless you also add a corresponding static import to Test4 class.

IMHO, Greclipse should just propose the qualified enumeration values.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions