Skip to content

Wrong insertion of guessed argument when "Completion overwrites" is chosen #500

@mauromol

Description

@mauromol

Found while verifying #367.

Consider the following Java enum:

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.doSom|
	} 
}

Consider these options in Java | Editor | Content assist:

  • Completion overwrites CHECKED
  • Use static imports UNCHECKED
  • Fill method arguments and show guessed arguments CHECKED
  • Insert best guessed arguments CHECKED

Invoke code assist at "|": you'll get Utility.doSomething(VAL3) (VAL3 highlighted) and then choose VAL1. The result is: Utility.doSomething(MyEnum.VAL3VAL1).

If "Use static imports" is CHECKED, the result, instead, is: Utility.doSomething(VAL3VAL1) (the added static import is correct, though).

The problem doesn't happen if you check "Completion inserts" instead of "Completion overwrites".

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions