LoginSignup
4
0

【Rust】rust-analyzerを使ったVSCodeのフォーマット設定

Posted at

import

フォーマッターの有効化

settings.json
"[rust]": {
	"editor.defaultFormatter": "rust-lang.rust-analyzer",
	"editor.formatOnSave": true,
	"editor.inlayHints.enabled": "off"
}

フォーマッターの設定

プロジェクトルートにrustfmt.tomlを追加して、設定を記述していきます。(.prettierrcみたいな感じです)

rustfmt.toml
tab_spaces = 2
max_width = 160
chain_width = 160

詳細は👇参照。

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0