rust-lang / rust-lang/rust-analyzer

vscode rust-analyzer formatOnSave not working

Open
#20,204 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-vscode C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

  • rust-analyzer version: 0.3.2527-standalone (0ac65592a8 2025-07-06)
  • rustc 1.85.0-nightly (7442931d4 2024-11-30)
  • VSCode Version: 1.101.2 (Universal) on macos sequoia 15.5

I have settings like this in my vscode user default settings:

	"editor.formatOnSave": true,
	"editor.formatOnType": true,
	"[rust]": {
		// "editor.defaultFormatter": "rust-lang.rust-analyzer",
		"editor.defaultFormatter": "rust-lang.rust-analyzer",
		"editor.formatOnSave": true,
		"editor.formatOnType": true
	},

but rust-analyzer still won't auto run format, everythings but this of rust-analyzer work great, and I have to run format document manually in vscode to format rust files

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

No repository file or test is named. Reproduce with rust-analyzer 0.3.2527-standalone, VSCode 1.101.2 on macOS, and the supplied formatOnSave settings; compare saving a Rust file with manually running Format Document. Done means Rust files format automatically on save without requiring the manual command.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.