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/user/manual.adoc') 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 From 9daa6b5cfa9e80a89fd1ae54bb5c2dc8baf988c6 Mon Sep 17 00:00:00 2001 From: Michael Bryan Date: Thu, 16 Jul 2020 23:30:02 +0800 Subject: Update docs/user/manual.adoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Laurențiu Nicola --- docs/user/manual.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/user/manual.adoc') diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index 7fa2e7da0..3d620cf81 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc @@ -372,7 +372,7 @@ You can use any valid RegExp as a mask. Also note that a full runnable name is s ==== 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. +Instead of relying on the built-in `cargo check`, you can configure Code to run a command in the background and use the `$rustc-watch` problem matcher to generate inline error markers from its output. 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. -- cgit v1.2.3 From 60a243b375fa9ec76c1d161c2455d90b4449b718 Mon Sep 17 00:00:00 2001 From: Michael Bryan Date: Thu, 16 Jul 2020 23:30:11 +0800 Subject: Update docs/user/manual.adoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Laurențiu Nicola --- docs/user/manual.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/user/manual.adoc') diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index 3d620cf81..d521d10cf 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc @@ -383,7 +383,7 @@ For example, if you want to run https://crates.io/crates/cargo-watch[`cargo watc "label": "Watch", "group": "build", "type": "shell", - "command": "cargo watch --package rust-analyzer", + "command": "cargo watch", "problemMatcher": "$rustc-watch", "isBackground": true } -- cgit v1.2.3 From 5226e886b04cc4db9fce841b84bd972d58b31bef Mon Sep 17 00:00:00 2001 From: Michael Bryan Date: Thu, 16 Jul 2020 23:30:19 +0800 Subject: Update docs/user/manual.adoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Laurențiu Nicola --- docs/user/manual.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/user/manual.adoc') diff --git a/docs/user/manual.adoc b/docs/user/manual.adoc index d521d10cf..f16b4ed8d 100644 --- a/docs/user/manual.adoc +++ b/docs/user/manual.adoc @@ -376,7 +376,7 @@ Instead of relying on the built-in `cargo check`, you can configure Code to run 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`: +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 { -- cgit v1.2.3