Skip to content

Commit dc9f794

Browse files
authored
Add troubleshooting section for RA path (#2892)
Added troubleshooting section to our root `CONTRIBUTING.md` file along with a section on setting the path for rust-analyzer to the one installed by the toolchain.
1 parent 303b438 commit dc9f794

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

CONTRIBUTING.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,33 @@ Samples may take the following categories of dependencies:
359359

360360
In general, we prefer taking dependencies on licensed components in the order of the listed categories. In cases where the category may not be well known, we'll document the category so that readers understand the choice that they're making by using that dependency.
361361

362+
## Troubleshooting
363+
364+
### Proc-macro map is missing error entry
365+
366+
If Visual Studio Code with the rust-analyzer extension active is showing an error for all code in the editor with an error similar to:
367+
368+
> tracing::function: internal error: proc-macro map is missing error entry for crate Crate(Id(6560))
369+
370+
This could be a discrepancy between your active Rust toolchain and the internal `rust-analyzer` the rust-analyzer extension distributes and uses by default.
371+
Because we do not currently mandate a specific version of the Rust toolchain in our `rust-toolchain.toml` (as long as it supports the MSRV in `Cargo.toml`),
372+
the version of `rust-analyzer` you have installed should match the active toolchain.
373+
374+
In your Visual Studio Code settings, add:
375+
376+
```json
377+
{
378+
"rust-analyzer.server.path": "${userHome}/.cargo/bin/rust-analyzer"
379+
}
380+
```
381+
382+
Set this to an appropriate path for local development. If you're running Visual Studio Code with a remote session e.g., WSL or SSH,
383+
you'll need to [open remote settings](https://code.visualstudio.com/docs/remote/troubleshooting#_local-absolute-path-settings-fail-when-applied-remotely) and add the configuration above.
384+
385+
1. Press `F1`.
386+
2. Type "open remote settings (json)" and press `Enter`.
387+
3. Add the above setting to your remote settings. If you use multiple remote sessions you'll need to do this for each one.
388+
362389
[C/C++]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
363390
[CodeLLDB]: https://marketplace.visualstudio.com/items?itemName=vadimcn.vscode-lldb
364391
[Rust Guidelines]: https://azure.github.io/azure-sdk/rust_introduction.html

0 commit comments

Comments
 (0)