Files
rust/.devcontainer/devcontainer.json

57 lines
1.2 KiB
JSON
Raw Permalink Normal View History

2019-05-01 13:00:29 -07:00
{
"name": "Rust",
2024-04-05 13:25:01 +05:30
"image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye",
2025-10-21 14:05:16 +08:00
// 先构建项目,但不自动运行
"postStartCommand": "cargo build && clear",
2022-05-17 12:42:11 -07:00
"customizations": {
"vscode": {
"settings": {},
2022-05-17 12:42:11 -07:00
"extensions": [
2025-10-21 14:05:16 +08:00
"streetsidesoftware.code-spell-checker",
"rust-lang.rust-analyzer", // 添加 Rust 语言支持
"vadimcn.vscode-lldb" // 添加 LLDB 调试器支持
],
// 添加调试配置
"debug": {
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug Rust Application",
"program": "${workspaceFolder}/target/debug/${workspaceFolderBasename}",
"args": [],
"cwd": "${workspaceFolder}",
"preLaunchTask": "cargo-build"
}
]
},
// 添加构建任务
"tasks": {
"tasks": [
{
"type": "cargo",
"command": "build",
"problemMatcher": [
"$rustc"
],
"group": "build",
"label": "cargo-build"
}
]
}
}
},
// 转发应用端口(根据你的实际端口修改)
"forwardPorts": [8080],
"portsAttributes": {
"8080": {
"label": "Rust Application",
"onAutoForward": "notify"
2022-05-17 12:42:11 -07:00
}
}
2025-10-21 14:05:16 +08:00
}