eclipse-jdt / eclipse-jdt/eclipse.jdt.ui

Static interface methods are not offered inside a lamda

Open
#762 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
59
Forks
127
Avg merge
22h 47m
Merged PRs (30d)
28

Description

Assume the following code:

```
public void nocomplete() {
List list = new ArrayList<>();
CompletableFuture.runAsync(() -> {
list.stream().forEach(str -> {
List. <---cursor here
System.out.println(str);
});
});
}
```
results in the following auto completion:

![grafik](https://github.com/eclipse-jdt/eclipse.jdt.ui/assets/1331477/f0b674fe-4b09-4419-9bb3-7826f33307bf)

adding a `;` at the end make the thing work:

```
public void nocomplete() {
List list = new ArrayList<>();
CompletableFuture.runAsync(() -> {
list.stream().forEach(str -> {
List. <---cursor here--> ;
System.out.println(str);
});
});
}
```

![grafik](https://github.com/eclipse-jdt/eclipse.jdt.ui/assets/1331477/986d0e7f-729c-4f4b-8e48-0bf44ed273c5)

in contrast for local variables it works without adding an extra `;` at the end:
![grafik](https://github.com/eclipse-jdt/eclipse.jdt.ui/assets/1331477/0e0160e8-07ea-4323-82ff-32410c132996)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.