【发布时间】:2022-01-15 17:27:36
【问题描述】:
https://imgur.com/a/Xv5y23Z 单击确定后,它向我显示了这个 https://imgur.com/a/zJwt4dw 我的扩展 https://imgur.com/a/CF8mRRV 代码很简单,hello world
【问题讨论】:
标签: visual-studio-2010 visual-studio-code rust
https://imgur.com/a/Xv5y23Z 单击确定后,它向我显示了这个 https://imgur.com/a/zJwt4dw 我的扩展 https://imgur.com/a/CF8mRRV 代码很简单,hello world
【问题讨论】:
标签: visual-studio-2010 visual-studio-code rust
不幸的是 VS Code 不能开箱即用地调试 Rust :(但不用担心,只需几个配置步骤即可完成工作:)
如果您在 Windows 上安装 C/C++ extension,如果在 OS X/Linux 上安装 CodeLLDB
点击Debug -> Add Configuration,应该会打开一个launch.json文件,你需要在此处手动更改program名称
{
"version": "0.2.0",
"configurations": [
{
"name": "(Windows) Launch",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceRoot}/target/debug/foo.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceRoot}",
"environment": [],
"externalConsole": true
},
{
"name": "(OSX) Launch",
"type": "lldb",
"request": "launch",
"program": "${workspaceRoot}/target/debug/foo",
"args": [],
"cwd": "${workspaceRoot}",
}
]
}
确保 Allow setting breakpoints in any file 在 File -> Preferences -> Settings
下勾选【讨论】: