【发布时间】:2022-11-04 16:20:29
【问题描述】:
我无法使用安装在 Windows 上的 VScode 调试 WSL 中的 rust 代码。我在debug 期间收到这些错误。
Error: there is no registered task type 'codelldb.cargo'. Did you miss installing an extension that provides a corresponding task provider?
Error: there is no registered task type 'codelldb.cargo'. Did you miss installing an extension that provides a corresponding task provider?
这是我的launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'foo'",
"cargo": {
"args": [
"build",
"--bin=foo",
"--package=foo"
],
"filter": {
"name": "foo",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
]
}
奇怪的是,我可以使用 vscode run 我的代码并获得预期的输出。
我在 vscode 中为 WSL 安装了以下扩展
codeLLDB
rust-analyzer
这些是软件的版本
WSL: version 1
vscode: 1.72.2
windows : Windows 10
我在这里缺少什么
【问题讨论】:
-
如果您单击
fn main()旁边的“调试”按钮,它是否有效? (需要安装rust-analyzer插件) -
不,它在那里也不起作用
-
可悲的是不能帮助你,我在 WSL2 上,它对我有用。如果有人有类似的问题,也许看看 rust-analyzer 错误跟踪器?
标签: visual-studio-code rust windows-subsystem-for-linux