eclipse-jdt / eclipse-jdt/eclipse.jdt.core

Completion not available on new line if previous line ends with a comment

Open
#3,962 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
237
Forks
195
Avg merge
1d 12h
Merged PRs (30d)
47

Description

In this case, the completion doesn't offer any method:
```java
List strings = Arrays.asList("one", "two", "three");

strings.stream() //
.mapToLong(String::length) // <--- COMMENT TO PREVENT FORMATTER FROM REMOVING LINE-BREAK
. <--- NO COMPLETION
```

If the previous line doesn't end with `//`, the completion works fine.
```java
List strings = Arrays.asList("one", "two", "three");

strings.stream() //
.mapToLong(String::length)
. <--- COMPLETION WORKS FINE
```

Not sure when exactly this bug was introduced, but late 2024 or early 2025.

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.