From feb53142fee49d8173741661a1a83960ba0265c9 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 17 Aug 2020 12:12:22 +0200 Subject: [PATCH] Document how to use build task for x.py check --- src/building/suggested.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/building/suggested.md b/src/building/suggested.md index 08858507f..0cc91b403 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`