From a0eaadee55312f693979fa5961719b889baa2815 Mon Sep 17 00:00:00 2001 From: Michael-F-Bryan Date: Thu, 16 Jul 2020 20:46:54 +0800 Subject: Mentioned problem matchers and running cargo-watch as a VS Code Task --- docs/user/manual.adoc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'docs') diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index 7816287e4..7fa2e7da0 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc @@ -369,3 +369,22 @@ Or it is possible to specify vars more granularly: ``` You can use any valid RegExp as a mask. Also note that a full runnable name is something like *run bin_or_example_name*, *test some::mod::test_name* or *test-mod some::mod*, so it is possible to distinguish binaries, single tests, and test modules with this masks: `"^run"`, `"^test "` (the trailing space matters!), and `"^test-mod"` respectively. + +==== Compiler feedback from external commands + +Instead of relying on the builtin `cargo check`, rust-analyzer can run a command in the background and use the `$rustc-watch` problem matcher to parse its output to generate inline error markers. + +To do this you need to create a new https://code.visualstudio.com/docs/editor/tasks[VS Code Task] and set `rust-analyzer.checkOnSave.enable: false` in preferences. + +For example, if you want to run https://crates.io/crates/cargo-watch[`cargo watch`] instead you might add the following to `.vscode/tasks.json`: + +```json +{ + "label": "Watch", + "group": "build", + "type": "shell", + "command": "cargo watch --package rust-analyzer", + "problemMatcher": "$rustc-watch", + "isBackground": true +} +``` -- cgit v1.2.3