Skip to content

Allow streaming formatting#6957

Closed
mansiverma897993 wants to merge 3 commits into
rust-lang:mainfrom
mansiverma897993:streaming-formatting
Closed

Allow streaming formatting#6957
mansiverma897993 wants to merge 3 commits into
rust-lang:mainfrom
mansiverma897993:streaming-formatting

Conversation

@mansiverma897993

Copy link
Copy Markdown

This PR implements streaming formatting via the --start-marker and --end-marker command-line options.

When both options are supplied, rustfmt reads from stdin streamingly, and detects blocks of Rust code enclosed by the start and end markers. Each block is formatted using the standard format_string mechanism and flushed to stdout immediately, followed by the end marker. This avoids the 30ms startup overhead on Windows for tools invoking rustfmt repeatedly.

An integration test is also included in tests/rustfmt/main.rs to verify the functionality.

@rustbot rustbot added the S-waiting-on-review Status: awaiting review from the assignee but also interested parties. label Jul 12, 2026
@ytmimi

ytmimi commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Before we jump into a PR I think we should first have some design discussion over on the original feature request issue. The issue description lacks a lot of detail so it's not even clear to me right now that this implementation satisfies the feature that's being requested. This is also a fairly low priority item. I'm going to close this PR for now.

@ytmimi ytmimi closed this Jul 16, 2026
@rustbot rustbot removed the S-waiting-on-review Status: awaiting review from the assignee but also interested parties. label Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants