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

Fix tasks in tasks.json #16970

Merged
merged 2 commits into from
Apr 1, 2024
Merged

Fix tasks in tasks.json #16970

merged 2 commits into from
Apr 1, 2024

Conversation

Wilfred
Copy link
Contributor

@Wilfred Wilfred commented Mar 28, 2024

#16839 refactored the representation of tasks inside the VS Code extension. However, this data type is exposed to users, who can define their own tasks in the same format in tasks.json or .code-workspace.

Revert the data type to have a command field rather than a program field, and document the different fields. This code is also a little complex, so split out a cargoToExecution to handle the Task to Execution conversion logic.

After this change, any tasks.json with a command field works again. For example, the following tasks.json works as expected:

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "cargo",
			"command": "build",
			"problemMatcher": [
			  "$rustc"
			],
			"group": "build",
			"label": "my example cargo build task"
		}
	]
}

Fixes #16943 #16949

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 28, 2024
@Wilfred Wilfred marked this pull request as ready for review March 28, 2024 23:00
@Wilfred Wilfred force-pushed the fix_tasks branch 2 times, most recently from 25353d3 to 91fd0d7 Compare March 29, 2024 00:41
@Veykril
Copy link
Member

Veykril commented Apr 1, 2024

Thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Apr 1, 2024

📌 Commit a758e34 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Apr 1, 2024

⌛ Testing commit a758e34 with merge f3f14d4...

@bors
Copy link
Contributor

bors commented Apr 1, 2024

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing f3f14d4 to master...

@bors bors merged commit f3f14d4 into rust-lang:master Apr 1, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VSCode tasks not generating
4 participants