2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

【Rust】VSCodeでauto format時のtab space sizeを2にする

Last updated at Posted at 2023-05-05

rust-analyzerを使用している前提で、settings.jsonに以下を追加する。

settings.json
"[rust]": {
  "editor.defaultFormatter": "rust-lang.rust-analyzer",
  "editor.formatOnSave": true,
  "editor.tabSize": 2
},
"rust-analyzer.rustfmt.extraArgs": ["--config", "tab_spaces=2"]


おまけ

エディター上に型ヒントを表示したくない場合は、以下を設定する。

settings.json
"[rust]": {
  "editor.inlayHints.enabled": "off"
},
2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?