Add separate "continuation indent space" setting
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
"tab_space = 2" will set my block indent to 2, but it also sets the indentation for continued lines (function params, long lines, etc) to 2 as well. It would be great to have a separate option for continued lines.
For example, the Google Style guide uses and indent=2 and continued_indent=4, which for me is more readable as I can easily see which indentations are blocks and which are continued lines just by scanning left alignment.
Perhaps we can add a 'continued_tab_space' option? To avoid changing behavior for just setting "tab_space = 2", perhaps we can default continued_tab_space to be unset, and when it is unset defer to tab_space for both?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating how the tab_space setting controls block and continued-line indentation in rustfmt. Add a separate continued_tab_space setting with the requested fallback to tab_space when unset, then verify both the default behavior and distinct Google-style values through the formatter's existing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100