From 75aa32f7b4bccace71ad78a3ad446b102eb5b853 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 17 Aug 2020 16:10:29 +0200 Subject: [PATCH] Document how to use build task for x.py check (#828) --- src/building/suggested.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/building/suggested.md b/src/building/suggested.md index 08858507..0cc91b40 100644 --- a/src/building/suggested.md +++ b/src/building/suggested.md @@ -28,6 +28,28 @@ you can write: 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. +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 When doing simple refactorings, it can be useful to run `./x.py check`