Compare commits

..

3 Commits

Author SHA1 Message Date
8866d7a3dc 删除forwardPorts 2025-10-27 10:09:38 +08:00
3383e71a9d 修改了devcontainer.json的生命周期钩子 2025-10-26 14:56:11 +00:00
b8ce918291 开发容器配置文件去除注释 2025-10-26 16:27:56 +08:00

View File

@@ -1,20 +1,16 @@
{ {
"name": "Rust", "name": "Rust",
"image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye", "image": "mcr.microsoft.com/devcontainers/rust:1-1-bullseye",
// 先构建项目,但不自动运行
"postStartCommand": "cargo build && clear",
"customizations": { "customizations": {
"vscode": { "vscode": {
"settings": {}, "settings": {},
"extensions": [ "extensions": [
"streetsidesoftware.code-spell-checker", "streetsidesoftware.code-spell-checker",
"rust-lang.rust-analyzer", // 添加 Rust 语言支持 "rust-lang.rust-analyzer",
"vadimcn.vscode-lldb" // 添加 LLDB 调试器支持 "vadimcn.vscode-lldb"
], ],
// 添加调试配置
"debug": { "debug": {
"configurations": [ "configurations": [
{ {
@@ -29,7 +25,6 @@
] ]
}, },
// 添加构建任务
"tasks": { "tasks": {
"tasks": [ "tasks": [
{ {
@@ -45,13 +40,12 @@
} }
} }
}, },
// 转发应用端口(根据你的实际端口修改)
"forwardPorts": [8080],
"portsAttributes": { "portsAttributes": {
"8080": { "8080": {
"label": "Rust Application", "label": "Rust Application",
"onAutoForward": "notify" "onAutoForward": "notify"
} }
} },
"postAttachCommand": "cargo build && clear"
} }