eclipse-jdt / eclipse-jdt/eclipse.jdt.core
code assist behaves differently in two places
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
### my usage
```java
public class Main {
private static void foo(String arg) {
}
private static void test() {
String myArg1 = "hi";
String myArg2 = "hi";
// place-1
foo(myArg1);
foo(myArg2);
if (true) {
// place-2
foo(myArg1);
foo(myArg2);
}
}
}
```
### expected behavior
I retype the method name "f|(myArg1);", auto-completion appears and I choose "foo", then I want to keep method parameters "myArg1" unchanged and get "foo(myArg1);" again.
### old version
In the old version(2019-06), it seems that the settings "Fill method arguments and show guessed arguments" only take effet when type a new line "f|", not when retype "f|(myArg1);". I only need to choose "Completion overwrites", then place-1 and place-2 both work fine. The "Fill method arguments……" can be disabled.
### problem
In the new version(2021-12/2022-03), it seems that the settings take effet when retype, so the auto-completed parameters is generated and not always unchanged. To keep method parameters unchanged, I must also enable "Fill method arguments……" and choose "Insert best guessed arguments"(if not, the auto-completed parameters is empty "()"). This makes place-1 works. But in place-2, the "best guessed arguments" is always "myArg2". That means I retype "foo(myArg1);" and finally get "foo(myArg2);". Is this means something wrong in the IDE's "guess strategy"? How can I keep the original arguments unchanged?
Contributor guide
Assessment
This issue has not been assessed yet.