Document how to use build task for x.py check (#828)

This commit is contained in:
Aleksey Kladov 2020-08-17 16:10:29 +02:00 committed by GitHub
parent 6a59d0df34
commit 75aa32f7b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -28,6 +28,28 @@ you can write:
in your `.vscode/settings.json` file. This will ask `rust-analyzer` to use in your `.vscode/settings.json` file. This will ask `rust-analyzer` to use
`x.py check` to check the sources, and the stage 0 rustfmt to format them. `x.py check` to check the sources, and the stage 0 rustfmt to format them.
If running `x.py check` on save is inconvenient, in VS Code you can use a [Build
Task] instead:
```JSON
// .vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "./x.py check",
"command": "./x.py check",
"type": "shell",
"problemMatcher": "$rustc",
"presentation": { "clear": true },
"group": { "kind": "build", "isDefault": true }
}
]
}
```
[Build Task]: https://code.visualstudio.com/docs/editor/tasks
## Check, check, and check again ## Check, check, and check again
When doing simple refactorings, it can be useful to run `./x.py check` When doing simple refactorings, it can be useful to run `./x.py check`