rust-lang / vscode-rust

Rust extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=rust-lang.rust
Other
1.39k stars 167 forks source link

There is no task provider registered for tasks of type "cargo". #856

Open devhawk opened 4 years ago

devhawk commented 4 years ago

I have a rust project that I haven't worked on in months. cloned it under WSL (Ubuntu 20.04). tasks.json file below. Tried to build in VSCode. ctrl+shift+b / Terminal -> Run Build Task... did nothing. Terminal -> Run Task... showed cargo check and cargo build tasks from tasks,json, but selecting either gives the "There is no task provider registered for tasks of type "cargo"." error.

Installed rust + vscode rust extension in windows, cloned my repo there and tried to build but had the same issue.

Versions:

tasks.json:

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558 
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "cargo check",
            "type": "cargo",
            "subcommand": "check",
            "problemMatcher": [
                "$rustc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "cargo build",
            "type": "cargo",
            "subcommand": "build",
            "problemMatcher": [
                "$rustc"
            ],
            "group": "build",
        }

    ]
}
devhawk commented 4 years ago

After manually installing rls, rust-analysis and rust-src on windows, extension tasks started to work. Installing those components on WSL did not resolve the issue