vscode-rust icon indicating copy to clipboard operation
vscode-rust copied to clipboard

command 'rust.cargo.build.debug' not found when pressing Ctrl-B

Open Boscop opened this issue 8 years ago • 6 comments

Version of VSCode: 1.14.2 Version of the extension: 0.4.2 OS: Win 8.1

Description:

When I press Ctrl-B, I get a popup that says:

command 'rust.cargo.build.debug' not found This is my config:

{
    "editor.wordWrap": "on",
    "files.autoSave": "onFocusChange",
    "rust.rustLangSrcPath": "D:\\Program Files\\.multirust\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\src\\rust\\src",
    "rust.rustup": {
        "toolchain": "stable-x86_64-pc-windows-msvc",
        "nightlyToolchain": "nightly-x86_64-pc-windows-msvc"
    },
    "rust.mode": "rls",
    "rust.rls": {
        "useRustfmt": false
    },
    "editor.renderWhitespace": "boundary"
}

Why doesn't it work?

Output of the "Rust logging" channel:

no output

Boscop avatar Aug 10 '17 17:08 Boscop

@Boscop, Are you sure there is no output in the "Rust logging" channel? Is there the channel at all?

I haven't set CTRL+B to invoke "rust.cargo.build.debug". I suppose you have done it.

The main reason is that there is no "rust.cargo.build.debug" command. There is "rust.cargo.build.default".

KalitaAlexey avatar Aug 10 '17 17:08 KalitaAlexey

"rust.cargo.build.debug" has been deleted a long time ago.

KalitaAlexey avatar Aug 10 '17 17:08 KalitaAlexey

Yes, I'm sure there is no output. There was output from before from when I uninstalled / reinstalled the extension to see if it would fix this. But I cleared the output to see what gets printed when I press Ctrl-B: Nothing. I hadn't used VSCode in a long time, like several months, but it was working before. But I didn't set rust.cargo.build.debug back then, I guess the extension set it. (I was using Sublime but it became really slow with RLS and I want to use VSCode now...)

What should I do now?

Btw, this is how my keybindings look like:

[
    { "key": "ctrl+k ctrl+b",    "command": "workbench.action.toggleSidebarVisibility" },
    { "key": "ctrl+b",           "command": "rust.cargo.build.debug",
                                        "when": "editorLangId == 'rust'" },
    { "key": "ctrl+shift+t",     "command": "rust.cargo.test.debug",
                                        "when": "editorLangId == 'rust'" },
    { "key": "ctrl+r",           "command": "rust.cargo.run.debug",
                                        "when": "editorLangId == 'rust'" },
    { "key": "ctrl+shift+b",     "command": "rust.cargo.build.release",
                                        "when": "editorLangId == 'rust'" },
    { "key": "ctrl+shift+alt+t", "command": "rust.cargo.test.release",
                                        "when": "editorLangId == 'rust'" },
    { "key": "ctrl+shift+r",     "command": "rust.cargo.run.release",
                                        "when": "editorLangId == 'rust'" }
    { "key": "f4",               "command": "editor.action.marker.next",
                                        "when": "editorFocus" },
    { "key": "shift+f4",         "command": "editor.action.marker.prev",
                                        "when": "editorFocus" },
]

Boscop avatar Aug 10 '17 20:08 Boscop

Analyze what commands the extension provide: https://github.com/editor-rs/vscode-rust/blob/master/package.json#L67 Change your keybindings. Shortly speaking, replace "debug" with "default" and "release" with "custom".

KalitaAlexey avatar Aug 11 '17 04:08 KalitaAlexey

Error still exists BTW

SamuelMarks avatar Nov 14 '18 05:11 SamuelMarks

In my case, i'm having command 'rust.cargo.build.default' not found.

Version of VSCode: 1.29.1 Version of the extension: 0.4.2 OS: Ubuntu Linux 16.04

This is my Rust Logging output:

DEBUG: Rustup: updateToolchains: this.toolchains=[{"channel":"nightly","host":"x86_64-unknown-linux-gnu","isDefault":true}]
DEBUG: activate: processPossibleSetButMissingUserToolchain: toolchainKind=toolchain
ERROR: activate: user toolchain is not installed

btw:

$ rustup show
Default host: x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-unknown-linux-gnu

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (directory override for '/home/01372329340')
rustc 1.30.0-nightly (887690686 2018-09-27)

hbobenicio avatar Nov 28 '18 17:11 hbobenicio