eclipse-jdt / eclipse-jdt/eclipse.jdt.core
Postfix completion is broken in some cases
- Dominant language
- Java
- Stars
- 237
- Forks
- 195
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 47
Description
Previously reported in https://github.com/redhat-developer/vscode-java/issues/3088, but reproduced in Eclipse 2023-03 and latest 2023-06 milestone:
After enabling postfix completion, try completing on .var:
```java
public static void main(String[] args) {
Stream.iterate(0,i -> ++i).limit(10).var|
}
```
This results in:
```java
public static void main(String[] String[] args = args) {
Stream.iterate(0,i -> ++i).limit(10);
}
```
or
```java
public static void main(String[] args) {
Stream v = Stream.iterate(0,i -> ++i).limit(10);
v.collect(Collectors.toList()).var|
}
```
yields:
```java
public static void main(String[] args) {
Stream Stream v = v = Stream.iterate(0, i -> ++i).limit(10);
v.collect(Collectors.toList());
}
```
Other postfix completions generate equally broken code.
Contributor guide
Assessment
This issue has not been assessed yet.