rust-lang / rust-lang/rustfmt

Request: "Compressed"

Open
#5,218 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request P-medium
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
2d 13h
Merged PRs (30d)
24

Description

Just how fn_args_layout works for function declarations, but make it work for function calls as well.

eg:

use super::*;

pub fn create_window_ex_w() {
  CreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
}

should become (depending on line with and such) something like this:

use super::*;

pub fn create_window_ex_w() {
  CreateWindowExW(dwExStyle, lpClassName, lpWindowName,
    dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu,
    hInstance, lpParam)
}

instead of going to a completely vertical layout.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the fn_args_layout option linked in the issue and compare its handling for function declarations with function calls. Reproduce the shown Rust example using rustfmt and verify that long calls use a compressed multi-line layout rather than a fully vertical one, while respecting line width.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.