rust-lang / rust-lang/rust-playground

Configuration option to "format on save"

Open
#987 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.4k
Forks
267
Avg merge
3h 2m
Merged PRs (30d)
6

Description

Similar in spirit to #844 , it could be nice to have automatic formatting whenever the code is "submitted" (i.e. Run / Test / Build etc.), although I think this should probably be configurable in user settings.

One thing that might be tricky is order of operations — The current rustfmt implementation seems to minimize its output after running, which would be fine so long as the subsequent "Run" command showed the output again. If they were run in parallel this might be hard to synchronize, but if Format always ran prior to Run perhaps it wouldn't be an issue.

Possible UI mockup (probably default to DISABLED, to avoid changing behavior from existing):

Screen Shot 2023-10-21 at 9 54 02 AM

Examples in other tools:

Contributor guide

No contributing guide indexed for this repository

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 by tracing the existing rustfmt implementation and the Run, Test, and Build command paths, then inspect how user settings and the shown UI are handled. Done means a configurable option, disabled by default, formats before submission and preserves the resulting output for the subsequent command.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.