Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support codelldb's cargo keyword #880

Closed
DieracDelta opened this issue Feb 27, 2023 · 1 comment
Closed

Support codelldb's cargo keyword #880

DieracDelta opened this issue Feb 27, 2023 · 1 comment

Comments

@DieracDelta
Copy link

DieracDelta commented Feb 27, 2023

Problem Statement

Codelldb supports cargo and drops the requirement for a program keyword in the launch.json. However, when I load in my launch.json and try to run it using the codelldb adaptor, I get a error saying that program is required. I'm guessing this is an additional feature needed on nvim-dap's side?

For reference, I'm trying to debug tests in this repo. The following launch.json works in vscode:

{
        "version": "0.2.0",
        "configurations": [
                {
                        "type": "rt_lldb",
                        "request": "launch",
                        "name": "debug the test",
                        "cargo": {
                                "args": [
                                        "test",
                                        "--package=hotshot-testing",
                                        "--test",
                                        "libp2p",
                                        "--features=full-ci, channel-async-std",
                                ],
                                "filter": {
                                        "name": "hotshot-testing",
                                        "kind": "lib"
                                }
                        },
                        "cwd": "${workspaceFolder}",
                }
        ]
}

But when I load it into neovim with:

:lua require('dap.ext.vscode').load_launchjs(nil, { ["rt_lldb"] = {"rust"} })
:DapContinue

I get the error Error on launch: "program" property is required for launch.

Note: I don't believe that this a codelldb adapter configuration issue--I'm configuring it with the adapter helper function from rust-tools. Debugging works great when I hardcode in program to the absolute path to the compiled test. It's just when I load_launchjs with a cargo attribute instead of a program, I get errors.

Possible Solutions

Not sure, probably add a hook/some logic to perform the translation in the load_launchjs function. I'm still working on familiarizing myself with this codebase. I'm planning to dig into this more, but just wanted to sanity check that I'm not missing something major before diving in.

Considered Alternatives

No response

@mfussenegger
Copy link
Owner

mfussenegger commented Feb 28, 2023

See #671 (comment), #771 (comment) and #720

@mfussenegger mfussenegger closed this as not planned Won't fix, can't repro, duplicate, stale Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants