Continuation of expression removes indentation
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 283
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 135
Description
Consider the following with a long expression that is continued at the next line with appropriate indentation:
```rust
fn foo(some_value: u32) -> u32 {
some_value + some_value + some_value + some_value + some_value + some_value + some_value +
some_value
}
```
The formatter removes this indentation of the continuation and starts the continuation in the column the original expression started:
```rust
fn foo(some_value: u32) -> u32 {
some_value + some_value + some_value + some_value + some_value + some_value + some_value +
some_value
}
```
I suspect aligning the continuation with the beginning of the original expression is only an issue in free-standing expressions used as a 'return from something' situation. In assignments, the current behavior produces good results as the indentation is given by the assignment in the line above:
```rust
fn foo(some_value: u32) {
let a = some_value + some_value + some_value + some_value + some_value + some_value + some_value +
some_value;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.