Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Only last "type": "cargo" build task shows up when running build tasks. #911

Open
lispink opened this issue May 16, 2021 · 0 comments
Open

Comments

@lispink
Copy link

lispink commented May 16, 2021

I have the issue that only one task is usable when you have multiple tasks of type cargo.

Example tasks.json:

{
	"version": "2.0.0",
	"type": "shell",
	"presentation": {
		"echo": true,
		"reveal": "silent",
		"focus": false,
		"panel": "shared",
		"showReuseMessage": false,
		"clear": true
	},
	"problemMatcher": [
		"$rustc"
	],
	"tasks": [
		{
			"label": "Rust: cargo build - minigrep",
			"type": "cargo",
			"subcommand": "build",
			"options": {
				"cwd": "${workspaceFolder}\\projects\\minigrep\\"
			},
			"group": "build"
		},
		{
			"label": "Rust: cargo build - playground",
			"type": "cargo",
			"subcommand": "build",
			"options": {
				"cwd": "${workspaceFolder}\\projects\\playground\\"
			},
			"group": "build"
		},
		{
			"label": "Rust: cargo build - hello_cargo",
			"type": "cargo",
			"subcommand": "build",
			"options": {
				"cwd": "${workspaceFolder}\\projects\\hello_cargo\\"
			},
			"group": "build"
		},
	]
}

When going to run a build task from vscode only the hello_cargo task shows up.
vscode build options

I found a similar solved issue on the vscode github.

I currently have a workaround by using the shell type:

{
	"version": "2.0.0",
	"type": "shell",
	"presentation": {
		"echo": true,
		"reveal": "silent",
		"focus": false,
		"panel": "shared",
		"showReuseMessage": false,
		"clear": true
	},
	"problemMatcher": [
		"$rustc"
	],
	"tasks": [
		{
			"label": "Rust: cargo build - minigrep",
			"type": "shell",
			"command": "cargo",
			"args": [
				"build"
			],
			"options": {
				"cwd": "${workspaceFolder}\\projects\\minigrep\\"
			},
			"group": "build"
		},
		{
			"label": "Rust: cargo build - playground",
			"type": "shell",
			"command": "cargo",
			"args": [
				"build"
			],
			"options": {
				"cwd": "${workspaceFolder}\\projects\\playground\\"
			},
			"group": "build"
		},
		{
			"label": "Rust: cargo build - hello_cargo",
			"type": "shell",
			"command": "cargo",
			"args": [
				"build"
			],
			"options": {
				"cwd": "${workspaceFolder}\\projects\\hello_cargo\\"
			},
			"group": "build"
		},
	]
}

Then vscode does show all 3 options.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant