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

tasks.json Support #4096

Merged
merged 1 commit into from
Apr 23, 2020
Merged

tasks.json Support #4096

merged 1 commit into from
Apr 23, 2020

Conversation

jcdickinson
Copy link

Move the task provider anonymous class into a real class, as this seems to be how Microsoft do this in their documentation.

resolveTask is now implemented, which is used by VSCode to determine how to execute tasks that the user has defined in tasks.json.

Resolves #3983

Move the task provider anonymous class into a real class, as this seems
to be how Microsoft do this in their documentation.

resolveTask is now implemented, which is used by VSCode to determine how
to execute tasks that the user has defined in tasks.json.
@jcdickinson
Copy link
Author

jcdickinson commented Apr 23, 2020

Turns out I didn't need much time to fix this :).

@matklad
Copy link
Member

matklad commented Apr 23, 2020

bors r+

Thanks!

@bors
Copy link
Contributor

bors bot commented Apr 23, 2020

@bors bors bot merged commit 8026a95 into rust-lang:master Apr 23, 2020
@Keavon
Copy link

Keavon commented Apr 26, 2020

@jcdickinson Is this a bad place to ask a question related to tasks.json? I am trying to make CtrlShiftB (the default build task) execute cargo run but I only see default options for cargo build and cargo check. I tried setting this to my tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cargo",
            "command": "run",
            "problemMatcher": [
                "$rustc"
            ],
            "group": { "kind": "build", "isDefault": true },
            "label": "rust: cargo run"
        }
    ]
}

But it's ignoring the default task, and just popping up the "Select the build task to run" palette menu and showing "There are task errors. See the output for details." where the Output console says:

Error: The cargo task detection didn't contribute a task for the following configuration:
{
    "type": "cargo",
    "command": "run",
    "problemMatcher": [
        "$rustc"
    ],
    "group": {
        "kind": "build",
        "isDefault": true
    },
    "label": "rust: cargo run"
}
The task will be ignored.

Can there be a default for cargo run or can this be fixed or explained to me how to fix it? I am running the latest non-nightly release (I just installed Rust Analyzer and didn't opt in to nightlies.)

(And again, sorry if this isn't the best spot for the question, I can also move it to an issue if it belongs there.)

@jcdickinson
Copy link
Author

@Keavon you will have to build the extension from source, or wait for an update on the VSCode extension store. The nightly setting wouldn't even help here, as that doesn't govern the version of the extension (it only covers the language server version).

@Keavon
Copy link

Keavon commented Apr 26, 2020

@jcdickinson I see, so it's a matter of the extension updating now the language server. And to clarify, the issue I was having is fixed now, just not yet deployed to the VS Code extension store? I don't quite understand what this merge request is about, but does it fix the problem I described? Once the web store updates, what behavior will I see? Thanks!

@jcdickinson
Copy link
Author

@Keavon you can download the VSIX from the updates page and manually install it to try out the changes.

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

Successfully merging this pull request may close these issues.

"cargo task detection didn't contribute a task for the following configuration"
3 participants