VS code部署RUST
- 開始之前
- 安裝語言環境
- 搭建測驗環境
- 結尾
開始之前
1、安裝rust
rust 安裝地址
2、切換到
msvc toolchain by rustup default stable-x86_64-pc-windows-msvc
3、安裝VSCODE
VS Code 安裝地址
安裝語言環境
- 安裝rls擴展

- 安裝Native Debug擴展

- 擴展rust-analyzer

搭建測驗環境
- 在工程目錄下新建.vscode目錄
- 在新建的 .vscode 檔案夾里新建兩個檔案 tasks.json 和 launch.json,檔案內容如下:
tasks.json 檔案
{
????"version":?"2.0.0",
????"tasks":?[
????????{
????????????"label":?"build",
????????????"type":?"shell",
????????????"command":"cargo",
????????????"args":?["build"]
????????}
????]
}
launch.json 檔案(適用在 Windows 系統上)
{
????"version":?"0.2.0",
????"configurations":?[
????????{
????????????"name":?"(Windows)?啟動",
????????????"preLaunchTask":?"build",
????????????"type":?"cppvsdbg",
????????????"request":?"launch",
????????????"program":?"${workspaceFolder}/target/debug/${workspaceFolderBasename}.exe",
????????????"args":?[],
????????????"stopAtEntry":?false,
????????????"cwd":?"${workspaceFolder}",
????????????"environment":?[],
????????????"externalConsole":?false
????????},
{
????????????"name":?"(gdb)?啟動",
????????????"type":?"cppdbg",
????????????"request":?"launch",
????????????"program":?"${workspaceFolder}/target/debug/${workspaceFolderBasename}.exe",
????????????"args":?[],
????????????"stopAtEntry":?false,
????????????"cwd":?"${workspaceFolder}",
????????????"environment":?[],
????????????"externalConsole":?false,
????????????"MIMode":?"gdb",
????????????"miDebuggerPath":?"這里填GDB所在的目錄",
????????????"setupCommands":?[
????????????????{
????????????????????"description":?"為?gdb?啟用整齊列印",
????????????????????"text":?"-enable-pretty-printing",
????????????????????"ignoreFailures":?true
????????????????}
????????????]
????????}
????]
}
- 下載visualcppbuildtools_full.exe
下載地址
結尾
配置成功!!!!

轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/229271.html
標籤:區塊鏈
