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

Missing rules in FORMATTER_KEEP_CODE_BLOCK_ON_ONE_LINE

Open
#864 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

In current state, `FORMATTER_KEEP_CODE_BLOCK_ON_ONE_LINE` only allows `{ ONE_LINE_NEVER, ONE_LINE_IF_EMPTY }`. Block formatting is missing rules `{ ONE_LINE_IF_SINGLE_ITEM, ONE_LINE_ALWAYS, ONE_LINE_PRESERVE }` from siblings:

- `FORMATTER_KEEP_IF_THEN_BODY_BLOCK_ON_ONE_LINE`
- `FORMATTER_KEEP_LOOP_BODY_BLOCK_ON_ONE_LINE`
- `FORMATTER_KEEP_LAMBDA_BODY_BLOCK_ON_ONE_LINE`

https://github.com/eclipse-jdt/eclipse.jdt.core/blob/57ae0e908f9aa809ddd40442d36c8a22b34fb4b8/org.eclipse.jdt.core/formatter/org/eclipse/jdt/core/formatter/DefaultCodeFormatterConstants.java#L5020-L5031

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.