Skip to content

feat(lsp): add debugOverrideCommand option#22236

Open
shorwood wants to merge 1 commit intorust-lang:masterfrom
shorwood:feat/lsp-debug-override-command
Open

feat(lsp): add debugOverrideCommand option#22236
shorwood wants to merge 1 commit intorust-lang:masterfrom
shorwood:feat/lsp-debug-override-command

Conversation

@shorwood
Copy link
Copy Markdown
Contributor

@shorwood shorwood commented May 1, 2026

Closes #22128

Adds debugOverrideCommand for test and bench runnables so debug can use a different command from Run. This is needed for runners like nextest, where running a test and debugging a test require different command shapes.

The setting is opt-in. Existing overrideCommand, Cargo debug config generation, and matching launch.json entries keep their current behavior.

For reference, here's my setup with this PR active.

{
    "rust-analyzer.server.path": "$HOME/Workspaces/rust-analyzer/target/debug/rust-analyzer",
    "rust-analyzer.runnables.test.overrideCommand": [
        "nix",
        "shell",
        "nixpkgs#cargo-nextest",
        "-c",
        "cargo",
        "nextest",
        "run",
        "--config",
        "profile.dev.debug=2",
        "--package",
        "${package}",
        "${target_arg}",
        "${target}",
        "--",
        "${test_name}",
        "${exact}",
        "${include_ignored}"
    ],
    "rust-analyzer.runnables.test.debugOverrideCommand": [
        "nix",
        "shell",
        "nixpkgs#cargo-nextest",
        "-c",
        "cargo",
        "nextest",
        "run",
        "--config",
        "profile.dev.debug=2",
        "--package",
        "${package}",
        "${target_arg}",
        "${target}",
        "--debugger",
        "$HOME/.vscode/extensions/vadimcn.vscode-lldb-1.12.1/bin/codelldb-launch --connect 127.0.0.1:12345 --",
        "--",
        "${test_name}",
        "${exact}",
        "${include_ignored}"
    ],
    "rust-analyzer.runnables.extraEnv": {
        "CODELLDB_LAUNCH_CONFIG": "{ token: 'secret' }"
    },
    "lldb.rpcServer": {
        "host": "127.0.0.1",
        "port": 12345,
        "token": "secret"
    }
}

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 1, 2026
@rustbot

This comment has been minimized.

@shorwood shorwood force-pushed the feat/lsp-debug-override-command branch from a7a3150 to 0e6e8b5 Compare May 1, 2026 08:26
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 4, 2026

☔ The latest upstream changes (possibly #22284) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom rust-analyzer.runnables.test.overrideCommand breaks Debug runnable button

2 participants