Skip to content

Instantly share code, notes, and snippets.

@munckymagik
Created January 15, 2020 19:49
Show Gist options
  • Save munckymagik/b08250c0e5c12d6971d346d5fcefdc7f to your computer and use it in GitHub Desktop.
Save munckymagik/b08250c0e5c12d6971d346d5fcefdc7f to your computer and use it in GitHub Desktop.
VSCode tasks with problem matchers for Rust
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build",
"type": "shell",
"command": "cargo build",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"clear": true,
},
"problemMatcher": {
"owner": "rust",
"fileLocation": [
"relative",
"${workspaceFolder}"
],
"pattern": [
{
"regexp": "(error(\\[E\\d+\\])?|warning): (.*)",
"severity": 1,
"message": 3
},
{
"regexp": "\\s+--> ([^:]+):(\\d+):(\\d+)",
"file": 1,
"line": 2,
"column": 3
}
]
}
},
{
"label": "Test",
"type": "shell",
"command": "cargo test --lib",
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"clear": true
},
"problemMatcher": {
"owner": "rust",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern":[
{
"regexp": "(error(\\[E\\d+\\])?|warning): (.*)",
"severity": 1,
"message": 3
},
{
"regexp": "\\s+--> ([^:]+):(\\d+):(\\d+)",
"file": 1,
"line": 2,
"column": 3
}
]
}
},
{
"label": "Format",
"type": "shell",
"command": "cargo fmt",
"presentation": {
"clear": true
},
"problemMatcher": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment