安装
vscode 安装插件
- rust-analyzer
- Native Debug
vscode 配置自动格式化代码
settings.json{"editor.defaultFoldingRangeProvider": null,"[rust]": {"editor.defaultFormatter": "rust-lang.rust-analyzer", // Makes the magic"editor.formatOnSave": true // Optional}
}
创建项目
cargo new hello1 

使用vscode打开文件夹

点击 Run/或者debug运行
- debug
  
- run
 