Skip to content

Commit 75aa32f

Browse files
authored
Document how to use build task for x.py check (#828)
1 parent 6a59d0d commit 75aa32f

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/building/suggested.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,28 @@ you can write:
2828
in your `.vscode/settings.json` file. This will ask `rust-analyzer` to use
2929
`x.py check` to check the sources, and the stage 0 rustfmt to format them.
3030

31+
If running `x.py check` on save is inconvenient, in VS Code you can use a [Build
32+
Task] instead:
33+
34+
```JSON
35+
// .vscode/tasks.json
36+
{
37+
"version": "2.0.0",
38+
"tasks": [
39+
{
40+
"label": "./x.py check",
41+
"command": "./x.py check",
42+
"type": "shell",
43+
"problemMatcher": "$rustc",
44+
"presentation": { "clear": true },
45+
"group": { "kind": "build", "isDefault": true }
46+
}
47+
]
48+
}
49+
```
50+
51+
[Build Task]: https://code.visualstudio.com/docs/editor/tasks
52+
3153
## Check, check, and check again
3254

3355
When doing simple refactorings, it can be useful to run `./x.py check`

0 commit comments

Comments
 (0)