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

[formatter] Wrapping indent on column

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

Description

The setting to wrap "indent to column" does not always generate code that respects the specified maximum line width.
For example, if the first parameter exceeds this limit, "indent to column" does not help.
The formatter should then use "default indentation" (or configurable) as given fallback in all cases,
where "indent to column" does not generate code respecting the max line width.

The line
```
final IllegalArgumentException exception = assertThrows( IllegalArgumentException.class, () -> sut.getClientPropertiesBySystem(null));
```

with line width 94 is wrapped into
```
final IllegalArgumentException exception = assertThrows(
IllegalArgumentException.class,
() -> sut.getClientPropertiesBySystem(null));
```
but still exceeds the line width.
In this case, it should be wrapped into
```
final IllegalArgumentException exception = assertThrows(
IllegalArgumentException.class, () -> sut.getClientPropertiesBySystem(null));
```

**Eclipse version:**
Version: 2022-06 (4.24.0)
Build id: 20220609-1112

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.