6 :source-highlighter: rouge
9 At its core, rust-analyzer is a *library* for semantic analysis of Rust code as it changes over time.
10 This manual focuses on a specific usage of the library -- running it as part of a server that implements the
11 https://microsoft.github.io/language-server-protocol/[Language Server Protocol] (LSP).
12 The LSP allows various code editors, like VS Code, Emacs or Vim, to implement semantic features like completion or goto definition by talking to an external language server process.
17 To improve this document, send a pull request: +
18 https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/manual.adoc[https://github.com/rust-analyzer/.../manual.adoc]
20 The manual is written in https://asciidoc.org[AsciiDoc] and includes some extra files which are generated from the source code. Run `cargo test` and `cargo test -p xtask` to create these and then `asciidoctor manual.adoc` to create an HTML copy.
23 If you have questions about using rust-analyzer, please ask them in the https://users.rust-lang.org/c/ide/14["`IDEs and Editors`"] topic of Rust users forum.
27 In theory, one should be able to just install the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>> and have it automatically work with any editor.
28 We are not there yet, so some editor specific setup is required.
30 Additionally, rust-analyzer needs the sources of the standard library.
31 If the source code is not present, rust-analyzer will attempt to install it automatically.
33 To add the sources manually, run the following command:
36 $ rustup component add rust-src
41 This is the best supported editor at the moment.
42 The rust-analyzer plugin for VS Code is maintained
43 https://github.com/rust-analyzer/rust-analyzer/tree/master/editors/code[in tree].
45 You can install the latest release of the plugin from
46 https://marketplace.visualstudio.com/items?itemName=matklad.rust-analyzer[the marketplace].
48 Note that the plugin may cause conflicts with the
49 https://marketplace.visualstudio.com/items?itemName=rust-lang.rust[official Rust plugin].
50 It is recommended to disable the Rust plugin when using the rust-analyzer extension.
52 By default, the plugin will prompt you to download the matching version of the server as well:
54 image::https://user-images.githubusercontent.com/9021944/75067008-17502500-54ba-11ea-835a-f92aac50e866.png[]
58 To disable this notification put the following to `settings.json`
62 { "rust-analyzer.updates.askBeforeDownload": false }
66 The server binary is stored in:
68 * Linux: `~/.config/Code/User/globalStorage/matklad.rust-analyzer`
69 * Linux (Remote, such as WSL): `~/.vscode-server/data/User/globalStorage/matklad.rust-analyzer`
70 * macOS: `~/Library/Application\ Support/Code/User/globalStorage/matklad.rust-analyzer`
71 * Windows: `%APPDATA%\Code\User\globalStorage\matklad.rust-analyzer`
73 Note that we only support two most recent versions of VS Code.
77 The extension will be updated automatically as new versions become available.
78 It will ask your permission to download the matching language server version binary if needed.
82 We ship nightly releases for VS Code.
83 To help us out with testing the newest code and follow the bleeding edge of our `master`, please use the following config:
87 { "rust-analyzer.updates.channel": "nightly" }
90 You will be prompted to install the `nightly` extension version.
91 Just click `Download now` and from that moment you will get automatic updates every 24 hours.
93 If you don't want to be asked for `Download now` every day when the new nightly version is released add the following to your `settings.json`:
96 { "rust-analyzer.updates.askBeforeDownload": false }
99 NOTE: Nightly extension should **only** be installed via the `Download now` action from VS Code.
101 ==== Manual installation
103 Alternatively, procure both `rust-analyzer.vsix` and your platform's matching `rust-analyzer-{platform}`, for example from the
104 https://github.com/rust-analyzer/rust-analyzer/releases[releases] page.
106 Install the extension with the `Extensions: Install from VSIX` command within VS Code, or from the command line via:
109 $ code --install-extension /path/to/rust-analyzer.vsix
112 Copy the `rust-analyzer-{platform}` binary anywhere, then add the path to your settings.json, for example:
115 { "rust-analyzer.server.path": "~/.local/bin/rust-analyzer-linux" }
118 ==== Building From Source
120 Alternatively, both the server and the Code plugin can be installed from source:
124 $ git clone https://github.com/rust-analyzer/rust-analyzer.git && cd rust-analyzer
125 $ cargo xtask install
128 You'll need Cargo, nodejs and npm for this.
130 Note that installing via `xtask install` does not work for VS Code Remote, instead you'll need to install the `.vsix` manually.
132 If you're not using Code, you can compile and install only the LSP server:
136 $ cargo xtask install --server
139 === rust-analyzer Language Server Binary
141 Other editors generally require the `rust-analyzer` binary to be in `$PATH`.
142 You can download the pre-built binary from the https://github.com/rust-analyzer/rust-analyzer/releases[releases] page.
143 Typically, you then need to rename the binary for your platform, e.g. `rust-analyzer-mac` if you're on Mac OS, to `rust-analyzer` and make it executable in addition to moving it into a directory in your `$PATH`.
145 On Linux to install the `rust-analyzer` binary into `~/.local/bin`, this commands could be used
149 $ curl -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-linux -o ~/.local/bin/rust-analyzer
150 $ chmod +x ~/.local/bin/rust-analyzer
153 Ensure `~/.local/bin` is listed in the `$PATH` variable.
155 Alternatively, you can install it from source using the command below.
156 You'll need the latest stable version of the Rust toolchain.
160 $ git clone https://github.com/rust-analyzer/rust-analyzer.git && cd rust-analyzer
161 $ cargo xtask install --server
164 If your editor can't find the binary even though the binary is on your `$PATH`, the likely explanation is that it doesn't see the same `$PATH` as the shell, see https://github.com/rust-analyzer/rust-analyzer/issues/1811[this issue].
165 On Unix, running the editor from a shell or changing the `.desktop` file to set the environment should help.
169 `rust-analyzer` is available in `rustup`, but only in the nightly toolchain:
173 $ rustup +nightly component add rust-analyzer-preview
178 The `rust-analyzer` binary can be installed from the repos or AUR (Arch User Repository):
180 - https://www.archlinux.org/packages/community/x86_64/rust-analyzer/[`rust-analyzer`] (built from latest tagged source)
181 - https://aur.archlinux.org/packages/rust-analyzer-git[`rust-analyzer-git`] (latest Git version)
183 Install it with pacman, for example:
187 $ pacman -S rust-analyzer
192 Note this excellent https://robert.kra.hn/posts/2021-02-07_rust-with-emacs/[guide] from https://github.com/rksm[@rksm].
194 Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
196 Emacs support is maintained as part of the https://github.com/emacs-lsp/lsp-mode[Emacs-LSP] package in https://github.com/emacs-lsp/lsp-mode/blob/master/lsp-rust.el[lsp-rust.el].
198 1. Install the most recent version of `emacs-lsp` package by following the https://github.com/emacs-lsp/lsp-mode[Emacs-LSP instructions].
199 2. Set `lsp-rust-server` to `'rust-analyzer`.
200 3. Run `lsp` in a Rust buffer.
201 4. (Optionally) bind commands like `lsp-rust-analyzer-join-lines`, `lsp-extend-selection` and `lsp-rust-analyzer-expand-macro` to keys.
205 Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
206 Not needed if the extension can install/update it on its own, coc-rust-analyzer is one example.
208 The are several LSP client implementations for vim or neovim:
210 ==== coc-rust-analyzer
212 1. Install coc.nvim by following the instructions at
213 https://github.com/neoclide/coc.nvim[coc.nvim]
215 2. Run `:CocInstall coc-rust-analyzer` to install
216 https://github.com/fannheyward/coc-rust-analyzer[coc-rust-analyzer],
217 this extension implements _most_ of the features supported in the VSCode extension:
218 * automatically install and upgrade stable/nightly releases
219 * same configurations as VSCode extension, `rust-analyzer.server.path`, `rust-analyzer.cargo.features` etc.
220 * same commands too, `rust-analyzer.analyzerStatus`, `rust-analyzer.ssr` etc.
221 * inlay hints for variables and method chaining, _Neovim Only_
222 * semantic highlighting is not implemented yet
224 Note: for code actions, use `coc-codeaction-cursor` and `coc-codeaction-selected`; `coc-codeaction` and `coc-codeaction-line` are unlikely to be useful.
226 ==== LanguageClient-neovim
228 1. Install LanguageClient-neovim by following the instructions
229 https://github.com/autozimu/LanguageClient-neovim[here]
230 * The GitHub project wiki has extra tips on configuration
232 2. Configure by adding this to your vim/neovim config file (replacing the existing Rust-specific line if it exists):
236 let g:LanguageClient_serverCommands = {
237 \ 'rust': ['rust-analyzer'],
243 Install YouCompleteMe by following the instructions
244 https://github.com/ycm-core/YouCompleteMe#installation[here].
246 rust-analyzer is the default in ycm, it should work out of the box.
250 To use the LSP server in https://github.com/dense-analysis/ale[ale]:
254 let g:ale_linters = {'rust': ['analyzer']}
259 NeoVim 0.5 (not yet released) has built-in language server support.
260 For a quick start configuration of rust-analyzer, use https://github.com/neovim/nvim-lspconfig#rust_analyzer[neovim/nvim-lspconfig].
261 Once `neovim/nvim-lspconfig` is installed, use `+lua require'lspconfig'.rust_analyzer.setup({})+` in your `init.vim`.
263 You can also pass LSP settings to the server:
268 local nvim_lsp = require'lspconfig'
270 local on_attach = function(client)
271 require'completion'.on_attach(client)
274 nvim_lsp.rust_analyzer.setup({
277 ["rust-analyzer"] = {
279 importGranularity = "module",
280 importPrefix = "by_self",
283 loadOutDirsFromCheck = true
294 See https://sharksforarms.dev/posts/neovim-rust/ for more tips on getting started.
298 vim-lsp is installed by following https://github.com/prabirshrestha/vim-lsp[the plugin instructions].
299 It can be as simple as adding this line to your `.vimrc`:
303 Plug 'prabirshrestha/vim-lsp'
306 Next you need to register the `rust-analyzer` binary.
307 If it is available in `$PATH`, you may want to add this to your `.vimrc`:
311 if executable('rust-analyzer')
312 au User lsp_setup call lsp#register_server({
313 \ 'name': 'Rust Language Server',
314 \ 'cmd': {server_info->['rust-analyzer']},
315 \ 'whitelist': ['rust'],
320 There is no dedicated UI for the server configuration, so you would need to send any options as a value of the `initialization_options` field, as described in the <<_configuration,Configuration>> section.
321 Here is an example of how to enable the proc-macro support:
325 if executable('rust-analyzer')
326 au User lsp_setup call lsp#register_server({
327 \ 'name': 'Rust Language Server',
328 \ 'cmd': {server_info->['rust-analyzer']},
329 \ 'whitelist': ['rust'],
330 \ 'initialization_options': {
332 \ 'loadOutDirsFromCheck': v:true,
344 Prerequisites: You have installed the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>>.
346 You also need the `LSP` package.
349 1. If you've never installed a Sublime Text package, install Package Control:
350 * Open the command palette (Win/Linux: `ctrl+shift+p`, Mac: `cmd+shift+p`)
351 * Type `Install Package Control`, press enter
352 2. In the command palette, run `Package control: Install package`, and in the list that pops up, type `LSP` and press enter.
354 Finally, with your Rust project open, in the command palette, run `LSP: Enable Language Server In Project` or `LSP: Enable Language Server Globally`, then select `rust-analyzer` in the list that pops up to enable the rust-analyzer LSP.
355 The latter means that rust-analyzer is enabled by default in Rust projects.
357 If it worked, you should see "rust-analyzer, Line X, Column Y" on the left side of the bottom bar, and after waiting a bit, functionality like tooltips on hovering over variables should become available.
359 If you get an error saying `No such file or directory: 'rust-analyzer'`, see the <<rust-analyzer-language-server-binary,`rust-analyzer` binary>> section on installing the language server binary.
363 GNOME Builder 3.37.1 and newer has native `rust-analyzer` support.
364 If the LSP binary is not available, GNOME Builder can install it when opening a Rust file.
369 Support for Rust development in the Eclipse IDE is provided by link:https://github.com/eclipse/corrosion[Eclipse Corrosion].
370 If available in PATH or in some standard location, `rust-analyzer` is detected and powers editing of Rust files without further configuration.
371 If `rust-analyzer` is not detected, Corrosion will prompt you for configuration of your Rust toolchain and language server with a link to the __Window > Preferences > Rust__ preference page; from here a button allows to download and configure `rust-analyzer`, but you can also reference another installation.
372 You'll need to close and reopen all .rs and Cargo files, or to restart the IDE, for this change to take effect.
376 Support for the language server protocol is built into Kate through the LSP plugin, which is included by default.
377 It is preconfigured to use Rls for rust sources, but allows you to use rust-analyzer through a simple settings change.
378 In the LSP Client settings of Kate, copy the content of the third tab "default parameters" to the second tab "server configuration".
379 Then in the configuration replace:
384 "rootIndicationFileNames": ["Cargo.lock", "Cargo.toml"],
385 "url": "https://github.com/rust-lang/rls",
386 "highlightingModeRegex": "^Rust$"
393 "command": ["rust-analyzer"],
394 "rootIndicationFileNames": ["Cargo.lock", "Cargo.toml"],
395 "url": "https://github.com/rust-analyzer/rust-analyzer",
396 "highlightingModeRegex": "^Rust$"
399 Then click on apply, and restart the LSP server for your rust project.
403 Start with looking at the rust-analyzer version.
404 Try **Rust Analyzer: Show RA Version** in VS Code and `rust-analyzer --version` in the command line.
405 If the date is more than a week ago, it's better to update rust-analyzer version.
407 The next thing to check would be panic messages in rust-analyzer's log.
408 Log messages are printed to stderr, in VS Code you can see then in the `Output > Rust Analyzer Language Server` tab of the panel.
409 To see more logs, set `RA_LOG=info` environmental variable.
411 To fully capture LSP messages between the editor and the server, set `"rust-analyzer.trace.server": "verbose"` config and check
412 `Output > Rust Analyzer Language Server Trace`.
414 The root cause for many "`nothing works`" problems is that rust-analyzer fails to understand the project structure.
415 To debug that, first note the `rust-analyzer` section in the status bar.
416 If it has an error icon and red, that's the problem (hover will have somewhat helpful error message).
417 **Rust Analyzer: Status** prints dependency information for the current file.
418 Finally, `RA_LOG=project_model=debug` enables verbose logs during project loading.
420 If rust-analyzer outright crashes, try running `rust-analyzer analysis-stats /path/to/project/directory/` on the command line.
421 This command type checks the whole project in batch mode bypassing LSP machinery.
423 When filing issues, it is useful (but not necessary) to try to minimize examples.
424 An ideal bug reproduction looks like this:
427 $ git clone https://github.com/username/repo.git && cd repo && git switch --detach commit-hash
428 $ rust-analyzer --version
429 rust-analyzer dd12184e4 2021-05-08 dev
430 $ rust-analyzer analysis-stats .
434 It is especially useful when the `repo` doesn't use external crates or the standard library.
438 **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/src/config.rs[config.rs]
440 The <<_installation,Installation>> section contains details on configuration for some of the editors.
441 In general `rust-analyzer` is configured via LSP messages, which means that it's up to the editor to decide on the exact format and location of configuration files.
443 Some clients, such as <<vs-code,VS Code>> or <<coc-rust-analyzer,COC plugin in Vim>> provide `rust-analyzer` specific configuration UIs. Others may require you to know a bit more about the interaction with `rust-analyzer`.
445 For the later category, it might help to know that the initial configuration is specified as a value of the `initializationOptions` field of the https://microsoft.github.io/language-server-protocol/specifications/specification-current/#initialize[`InitializeParams` message, in the LSP protocol].
446 The spec says that the field type is `any?`, but `rust-analyzer` is looking for a JSON object that is constructed using settings from the list below.
447 Name of the setting, ignoring the `rust-analyzer.` prefix, is used as a path, and value of the setting becomes the JSON property value.
449 For example, a very common configuration is to enable proc-macro support, can be achieved by sending this JSON:
455 "loadOutDirsFromCheck": true,
463 Please consult your editor's documentation to learn more about how to configure https://microsoft.github.io/language-server-protocol/[LSP servers].
465 To verify which configuration is actually used by `rust-analyzer`, set `RA_LOG` environment variable to `rust_analyzer=info` and look for config-related messages.
466 Logs should show both the JSON that `rust-analyzer` sees as well as the updated config.
468 This is the list of config options `rust-analyzer` supports:
470 include::./generated_config.adoc[]
472 == Non-Cargo Based Projects
474 rust-analyzer does not require Cargo.
475 However, if you use some other build system, you'll have to describe the structure of your project for rust-analyzer in the `rust-project.json` format:
479 interface JsonProject {
480 /// Path to the directory with *source code* of
483 /// It should point to the directory where std,
484 /// core, and friends can be found:
486 /// https://github.com/rust-lang/rust/tree/master/library.
488 /// If provided, rust-analyzer automatically adds
489 /// dependencies on sysroot crates. Conversely,
490 /// if you omit this path, you can specify sysroot
491 /// dependencies yourself and, for example, have
492 /// several different "sysroots" in one graph of
494 sysroot_src?: string;
495 /// The set of crates comprising the current
496 /// project. Must include all transitive
497 /// dependencies as well as sysroot crate (libstd,
498 /// libcore and such).
503 /// Optional crate name used for display purposes,
504 /// without affecting semantics. See the `deps`
505 /// key for semantically-significant crate names.
506 display_name?: string;
507 /// Path to the root module of the crate.
509 /// Edition of the crate.
510 edition: "2015" | "2018" | "2021";
513 /// Should this crate be treated as a member of
514 /// current "workspace".
516 /// By default, inferred from the `root_module`
517 /// (members are the crates which reside inside
518 /// the directory opened in the editor).
520 /// Set this to `false` for things like standard
521 /// library and 3rd party crates to enable
522 /// performance optimizations (rust-analyzer
523 /// assumes that non-member crates don't change).
524 is_workspace_member?: boolean;
525 /// Optionally specify the (super)set of `.rs`
526 /// files comprising this crate.
528 /// By default, rust-analyzer assumes that only
529 /// files under `root_module.parent` can belong
530 /// to a crate. `include_dirs` are included
531 /// recursively, unless a subdirectory is in
534 /// Different crates can share the same `source`.
536 /// If two crates share an `.rs` file in common,
537 /// they *must* have the same `source`.
538 /// rust-analyzer assumes that files from one
539 /// source can't refer to files in another source.
541 include_dirs: string[],
542 exclude_dirs: string[],
544 /// The set of cfgs activated for a given crate, like
545 /// `["unix", "feature=\"foo\"", "feature=\"bar\""]`.
547 /// Target triple for this Crate.
549 /// Used when running `rustc --print cfg`
550 /// to get target-specific cfgs.
552 /// Environment variables, used for
554 env: : { [key: string]: string; },
556 /// For proc-macro crates, path to compiled
557 /// proc-macro (.so file).
558 proc_macro_dylib_path?: string;
562 /// Index of a crate in the `crates` array.
564 /// Name as should appear in the (implicit)
565 /// `extern crate name` declaration.
570 This format is provisional and subject to change.
571 Specifically, the `roots` setup will be different eventually.
573 There are tree ways to feed `rust-project.json` to rust-analyzer:
575 * Place `rust-project.json` file at the root of the project, and rust-anlayzer will discover it.
576 * Specify `"rust-analyzer.linkedProjects": [ "path/to/rust-project.json" ]` in the settings (and make sure that your LSP client sends settings as a part of initialize request).
577 * Specify `"rust-analyzer.linkedProjects": [ { "roots": [...], "crates": [...] }]` inline.
579 Relative paths are interpreted relative to `rust-project.json` file location or (for inline JSON) relative to `rootUri`.
581 See https://github.com/rust-analyzer/rust-project.json-example for a small example.
583 You can set `RA_LOG` environmental variable to `rust_analyzer=info` to inspect how rust-analyzer handles config and project loading.
587 At the moment, rust-analyzer assumes that all code is trusted.
588 Here is a **non-exhaustive** list of ways to make rust-analyzer execute arbitrary code:
590 * proc macros and build scripts are executed by default
591 * `.cargo/config` can override `rustc` with an arbitrary executable
592 * `rust-toolchain.toml` can override `rustc` with an arbitrary executable
593 * VS Code plugin reads configuration from project directory, and that can be used to override paths to various executables, like `rustfmt` or `rust-analyzer` itself.
594 * rust-analyzer's syntax trees library uses a lot of `unsafe` and hasn't been properly audited for memory safety.
596 rust-analyzer itself doesn't access the network.
597 The VS Code plugin doesn't access the network unless the nightly channel is selected in the settings.
598 In that case, the plugin uses the GitHub API to check for and download updates.
602 include::./generated_features.adoc[]
604 == Assists (Code Actions)
606 Assists, or code actions, are small local refactorings, available in a particular context.
607 They are usually triggered by a shortcut or by clicking a light bulb icon in the editor.
608 Cursor position or selection is signified by `┃` character.
610 include::./generated_assists.adoc[]
614 While most errors and warnings provided by rust-analyzer come from the `cargo check` integration, there's a growing number of diagnostics implemented using rust-analyzer's own analysis.
615 Some of these diagnostics don't respect `\#[allow]` or `\#[deny]` attributes yet, but can be turned off using the `rust-analyzer.diagnostics.enable`, `rust-analyzer.diagnostics.enableExperimental` or `rust-analyzer.diagnostics.disabled` settings.
617 include::./generated_diagnostic.adoc[]
622 ==== Color configurations
624 It is possible to change the foreground/background color of inlay hints.
625 Just add this to your `settings.json`:
630 "workbench.colorCustomizations": {
631 // Name of the theme you are currently using
633 "rust_analyzer.inlayHints.foreground": "#868686f0",
634 "rust_analyzer.inlayHints.background": "#3d3d3d48",
636 // Overrides for specific kinds of inlay hints
637 "rust_analyzer.inlayHints.foreground.typeHints": "#fdb6fdf0",
638 "rust_analyzer.inlayHints.foreground.paramHints": "#fdb6fdf0",
639 "rust_analyzer.inlayHints.background.chainingHints": "#6b0c0c81"
645 ==== Semantic style customizations
647 You can customize the look of different semantic elements in the source code.
648 For example, mutable bindings are underlined by default and you can override this behavior by adding the following section to your `settings.json`:
653 "editor.semanticTokenColorCustomizations": {
656 "fontStyle": "", // underline is the default
663 Most themes doesn't support styling unsafe operations differently yet. You can fix this by adding overrides for the rules `operator.unsafe`, `function.unsafe`, and `method.unsafe`:
668 "editor.semanticTokenColorCustomizations": {
670 "operator.unsafe": "#ff6600",
671 "function.unsafe": "#ff6600"
672 "method.unsafe": "#ff6600"
678 In addition to the top-level rules you can specify overrides for specific themes. For example, if you wanted to use a darker text color on a specific light theme, you might write:
683 "editor.semanticTokenColorCustomizations": {
685 "operator.unsafe": "#ff6600"
689 "operator.unsafe": "#572300"
696 Make sure you include the brackets around the theme name. For example, use `"[Ayu Light]"` to customize the theme Ayu Light.
698 ==== Special `when` clause context for keybindings.
699 You may use `inRustProject` context to configure keybindings for rust projects only.
706 "command": "rust-analyzer.toggleInlayHints",
707 "when": "inRustProject"
710 More about `when` clause contexts https://code.visualstudio.com/docs/getstarted/keybindings#_when-clause-contexts[here].
712 ==== Setting runnable environment variables
713 You can use "rust-analyzer.runnableEnv" setting to define runnable environment-specific substitution variables.
714 The simplest way for all runnables in a bunch:
716 "rust-analyzer.runnableEnv": {
717 "RUN_SLOW_TESTS": "1"
721 Or it is possible to specify vars more granularly:
723 "rust-analyzer.runnableEnv": [
725 // "mask": null, // null mask means that this rule will be applied for all runnables
734 "APP_ID": "2", // overwrites only APP_ID
740 You can use any valid regular expression as a mask.
741 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.
743 ==== Compiler feedback from external commands
745 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.
747 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.
749 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`:
756 "command": "cargo watch",
757 "problemMatcher": "$rustc-watch",