首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法用WSL设置调试vscode中的Rust代码

无法用WSL设置调试vscode中的Rust代码
EN

Stack Overflow用户
提问于 2022-10-19 14:50:42
回答 1查看 143关注 0票数 0

我无法用安装在窗口上的VScode调试WSL中的锈蚀代码。在debug期间,我会得到这些错误。

代码语言:javascript
复制
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

代码语言:javascript
复制
{
    "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的扩展名。

代码语言:javascript
复制
codeLLDB
rust-analyzer

这些是软件的版本。

代码语言:javascript
复制
WSL: version 1
vscode: 1.72.2
windows : Windows 10

我在这里所缺少的

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-11-04 08:20:29

这个问题是由于WSL版本。将WSL从v1升级到v2后,问题得到了解决

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74127500

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档