Vscode-rust: No tasks in VSC 1.25.0

Created on 5 Jul 2018  路  19Comments  路  Source: rust-lang/vscode-rust

The default tasks are no longer available after upgrading to VSC 1.25.0.

To duplicate, upgrade to VSC 1.25.0, click the Tasks menu, click the Run Task menu item item and note that the list is now empty.

bug

Most helpful comment

I'm still having a few issues. I get the tasks showing up, but when I try to use one (doesn't matter which one), I get:
> Executing task in folder ProjectFolder: cargo task <
Followed by nothing (doesn't seem to run at all); where task is one of run, build, check, bench, clean, or test.

If I "Configure Tasks" and change "type": "cargo", to "type": "shell",, it runs as expected. If I run cargo task from the command line, it runs as expected.

I've tested with a few projects, even just a basic "Hello World" style project!

All 19 comments

Issue confirmed with VSCode 1.25.0 on Arch Linux x86_64.

Also happening with VSCode 1.25.0 on Fedora 28.

Confirmed on Windows 10 as well.

Could someone please share a template in the meantime until it's fixed?

In the meantime, you can get the tasks by looking at the source; they're added here: https://github.com/rust-lang-nursery/rls-vscode/blob/master/src/tasks.ts#L88-L169

Here is the implicit tasks.json that would have been generated:

{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "type": "shell",
      "label": "cargo build",
      "command": "cargo",
      "args": [
        "build"
      ],
      "problemMatcher": [
        "$rustc"
      ]
    },
    {
      "type": "shell",
      "label": "cargo check",
      "command": "cargo",
      "args": [
        "check"
      ],
      "problemMatcher": [
        "$rustc"
      ]
    },
    {
      "type": "shell",
      "label": "cargo clean",
      "command": "cargo",
      "args": [
        "clean"
      ],
      "problemMatcher": []
    },
    {
      "type": "shell",
      "label": "cargo run",
      "command": "cargo",
      "args": [
        "run"
      ],
      "problemMatcher": [
        "$rustc"
      ]
    },
    {
      "type": "shell",
      "label": "cargo test",
      "command": "cargo",
      "args": [
        "test"
      ],
      "problemMatcher": [
        "$rustc"
      ]
    }
  ]
}

Fixed by #361

Confirmed that this works for me. Thank you @nrc and @HyperHamster!

Released 0.4.7 with this fix

Works for me, thanks.

I'm still having a few issues. I get the tasks showing up, but when I try to use one (doesn't matter which one), I get:
> Executing task in folder ProjectFolder: cargo task <
Followed by nothing (doesn't seem to run at all); where task is one of run, build, check, bench, clean, or test.

If I "Configure Tasks" and change "type": "cargo", to "type": "shell",, it runs as expected. If I run cargo task from the command line, it runs as expected.

I've tested with a few projects, even just a basic "Hello World" style project!

@scautura Yes, happens to me as well (Windows 10)

@TomMarius +1

If you try to "Configure Task", the generated task has "cargo" in the "type" field. Apparently, this should be "shell" or "process". Here is a fixed tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "label": "cargo build",
            "command": "cargo",
            "args": [
                "build"
            ],
            "problemMatcher": [
                "$rustc"
            ],
            "group": "build"
        },
        {
            "type": "shell",
            "label": "cargo check",
            "command": "cargo",
            "args": [
                "check"
            ],
            "problemMatcher": [
                "$rustc"
            ],
            "group": "build"
        },
        {
            "type": "shell",
            "label": "cargo run",
            "command": "cargo",
            "args": [
                "run"
            ],
            "problemMatcher": [
                "$rustc"
            ],
        },
        {
            "type": "shell",
            "label": "cargo test",
            "command": "cargo",
            "args": [
                "test"
            ],
            "problemMatcher": [
                "$rustc"
            ],
            "group": "test"
        },
        {
            "type": "shell",
            "label": "cargo bench",
            "command": "cargo",
            "args": [
                "+nightly",
                "bench"
            ],
            "problemMatcher": [
                "$rustc"
            ],
            "group": "test"
        },
        {
            "type": "shell",
            "label": "cargo clean",
            "command": "cargo",
            "args": [
                "clean"
            ],
            "problemMatcher": []
        },
    ]
}

cc @matklad re the last comment. Would you expect changing the type to cargo to break things?

No, I think we must define a fresh type of tasks to make things work. I am not too sure about this, but, for example, cake defines the new type:
https://github.com/Microsoft/vscode/issues/53673#issuecomment-402987914.

I wonder what distinguish setups of people for whom type cargo does not work?

I think this might be the fix: https://github.com/rust-lang-nursery/rls-vscode/pull/376. However, I still can't reproduce the issue locally, on


Version: 1.25.0
Commit: 0f080e5267e829de46638128001aeb7ca2d6d50e
Date: 2018-07-05T13:10:37.273Z
Electron: 1.7.12
Chrome: 58.0.3029.110
Node.js: 7.9.0
V8: 5.8.283.38
Architecture: x64

everything seems to work even with 'rust'.

Reprodced, this is windows specific.

Ok, the actual fix is https://github.com/rust-lang-nursery/rls-vscode/pull/371 :)

Closed by #371

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hpesoj picture hpesoj  路  5Comments

views63 picture views63  路  5Comments

sfackler picture sfackler  路  6Comments

olehmisar picture olehmisar  路  5Comments

iBeizsley picture iBeizsley  路  3Comments