Skip to content

Commit

Permalink
docs: Add linkedProjects section to Rust docs (#19954)
Browse files Browse the repository at this point in the history
Related to #19897

Adds a section about multi-project workspaces and how to configure
rust-analyzer to diagnose them even if the cargo workspace does not list
them

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <[email protected]>
  • Loading branch information
SkymanOne and maxdeviant authored Oct 30, 2024
1 parent c564a4a commit f84f3ff
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/src/languages/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,23 @@ Here's a snippet for Zed settings.json (the language server will restart automat
}
```

### Multi-project workspaces

If you want rust-analyzer to analyze multiple Rust projects in the same folder that are not listed in `[members]` in the Cargo workspace,
you can list them in `linkedProjects` in the local project settings:

```json
{
"lsp": {
"rust-analyzer": {
"initialization_options": {
"linkedProjects": ["./path/to/a/Cargo.toml", "./path/to/b/Cargo.toml"]
}
}
}
}
```

### Snippets

There's a way get custom completion items from rust-analyzer, that will transform the code according to the snippet body:
Expand Down

0 comments on commit f84f3ff

Please sign in to comment.