rust-lang / rust-lang/rust-playground
Configuration option to "format on save"
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):
Examples in other tools:
- https://go.dev/play/ (not my favorite playground, but I do like this particular feature)
- https://goplay.tools/
Contributor guide
No contributing guide indexed for this repository
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 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